--- projects/cms/source/reports/php/latest/latest.php 2002/10/21 13:02:58 1.43 +++ projects/cms/source/reports/php/latest/latest.php 2003/03/10 21:17:42 1.44 @@ -83,12 +83,12 @@ function showDisks($diskRoot, $units, $input) { $mount = getPregMatch("$diskRoot.p$i.attributes.mount", $input); if ($name || $mount) { $used = "$diskRoot.p$i.attributes.used"; - $kbytes = "$diskRoot.p$i.attributes.kbytes"; + $total = "$diskRoot.p$i.attributes.total"; $graph = preg_replace("/_/", "$hex_underscore", $mount); $graph = preg_replace("/\//", "$hex_slash", $graph); $totalinodes = getPregMatch("$diskRoot.p$i.attributes.totalinodes", $input); $freeinodes = getPregMatch("$diskRoot.p$i.attributes.freeinodes", $input); - showBar("$name ($mount)
space used", $used, $kbytes, $units, $input, "disk-$graph"); + showBar("$name ($mount)
space used", $used, $total, $units, $input, "disk-$graph"); showBar("inodes used", (int) $freeinodes, (int) $totalinodes, " inodes", $input, "", "swap"); print "

\n"; } @@ -98,6 +98,49 @@ function showDisks($diskRoot, $units, $input) { $i++; } } + + +# show all disk IO information. +function showDiskIO($diskRoot, $input) { + include("latest_config.inc.php"); + + $i = 0; + while(1) { + $name = getPregMatch("$diskRoot.p$i.attributes.name", $input); + if ($name) { + print "
(Disk $name)
"; + showStat("Read bytes (per sec)", "$diskRoot.p$i.attributes.rbytes", $input, "diskio-$name"); + showStat("Write bytes (per sec)", "$diskRoot.p$i.attributes.wbytes", $input, "diskio-$name"); + print "
\n"; + } + else { + break; + } + $i++; + } +} + + +# show all network information. +function showNet($netRoot, $input) { + include("latest_config.inc.php"); + + $i = 0; + while(1) { + $name = getPregMatch("$netRoot.p$i.attributes.name", $input); + if ($name) { + print "
(Network Interface $name)
"; + showStat("Received bytes (per sec)", "$netRoot.p$i.attributes.rx", $input, "net-$name"); + showStat("Transfered bytes (per sec)", "$netRoot.p$i.attributes.tx", $input, "net-$name"); + print "
\n"; + } + else { + break; + } + $i++; + } +} + # Return a preg_match result. function getPregMatch($value, $input) {