".TD2.LG_FONT."Host Information:\n";
row("IP address: ", "$host->last_ip_addr
(same the last $host->nsame_ip_addr times)");
row("Domain name: ", $host->domain_name);
$x = $host->timezone/3600;
row("Time zone: ", "UTC - $x hours");
row("Created: ", time_str($host->create_time));
row("Total Credit:", $host->total_credit);
row("Recent average credit:", $host->expavg_credit);
row("CPU: ", "$host->p_vendor $host->p_model");
row("Number of CPUs: ", $host->p_ncpus);
row("Operating System: ", "$host->os_name $host->os_version");
$x = $host->m_nbytes/(1024*1024);
$y = round($x, 2);
row("Memory: ", "$y MB");
$x = $host->m_cache/1024;
$y = round($x, 2);
row("Cache: ", "$y KB");
$x = $host->m_swap/(1024*1024);
$y = round($x, 2);
row("Swap Space: ", "$y MB");
$x = $host->d_total/(1024*1024*1024);
$y = round($x, 2);
row("Total Disk Space: ", "$y GB");
$x = $host->d_free/(1024*1024*1024);
$y = round($x, 2);
row("Free Disk Space: ", "$y GB");
row("Avg upload speed:", "$host->n_bwup bytes/sec");
row("Avg download speed:
", "$host->n_bwdown bytes/sec");
row("Number of times client has contacted server: ", $host->rpc_seqno);
row("Last time contacted server: ", time_str($host->rpc_time));
row("% of time client on: ", 100*$host->on_frac." %");
row("% of time host connected: ", 100*$host->connected_frac." %");
row("% of time user active: ", 100*$host->active_frac." %");
echo "\n";
}
$authenticator = init_session();
db_init();
$user = get_user_from_auth($authenticator);
$hostid = $HTTP_GET_VARS["hostid"];
if ($user && $hostid) {
page_head("Host stats");
$result = mysql_query("select * from host where id = $hostid and userid = $user->id");
$host = mysql_fetch_object($result);
mysql_free_result($result);
if ($host) {
show_host($host);
} else {
echo "Couldn't find host or user.
"; } page_tail(); } else { print_login_form(); } ?>