".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");
$x = $host->p_fpops/(1000*1000);
$y = round($x, 2);
row("Measured floating point speed: ", "$y million ops/sec");
$x = $host->p_iops/(1000*1000);
$y = round($x, 2);
row("Measured integer speed: ", "$y million ops/sec");
$x = $host->p_membw/(1024*1024);
$y = round($x, 2);
row("Measured memory bandwidth: ", "$y MB/sec");
$x = $host->n_bwup/(1024);
$y = round($x, 2);
if ($y > 0)
row("Avg upload speed:", "$y KB/sec");
else
row("Avg upload speed:
", "Unknown");
$x = $host->n_bwdown/(1024);
$y = round($x, 2);
if ($y > 0)
row("Avg download speed:
", "$y KB/sec");
else
row("Avg download speed:
", "Unknown");
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");
$host = mysql_fetch_object($result);
mysql_free_result($result);
if ($host) {
if ($host->userid != $user->id) {
echo "Not your host\n";
} else {
show_host($host);
}
} else {
echo "Couldn't find host or user.
"; } page_tail(); } else { print_login_form(); } ?>