fix etherlike graphing,more storage changes, create health aggregate page

git-svn-id: http://www.observium.org/svn/observer/trunk@946 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-02-24 21:44:32 +00:00
parent eb7ffda978
commit 17fe4219c2
8 changed files with 54 additions and 48 deletions

View File

@@ -2,7 +2,6 @@
include("cpu.inc.php");
include("memory.inc.php");
include("hrstorage.inc.php");
include("temperatures.inc.php");
include("netstats.inc.php");
include("laload.inc.php");

View File

@@ -2,7 +2,6 @@
include("cpu.inc.php");
include("memory.inc.php");
include("hrstorage.inc.php");
include("temperatures.inc.php");
include("netstats.inc.php");
include("laload.inc.php");

View File

@@ -2,7 +2,7 @@
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE device_id = '" . $device['device_id'] . "'"),0)) {
$graph_title = "Storage";
$graph_type = "device_hrstorage";
$graph_type = "device_storage";
include ("includes/print-device-graph.php");
}

View File

@@ -1,20 +1,20 @@
<?php
$temp = mysql_result(mysql_query("select count(*) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0);
$temperatures = mysql_result(mysql_query("select count(*) from temperature WHERE device_id = '" . $device['device_id'] . "'"), 0);
$storage = mysql_result(mysql_query("select count(*) from storage WHERE device_id = '" . $device['device_id'] . "'"), 0);
$memory = mysql_result(mysql_query("select count(*) from mempools WHERE device_id = '" . $device['device_id'] . "'"), 0);
$processor = mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"), 0);
$fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0);
$volts = mysql_result(mysql_query("select count(*) from voltage WHERE device_id = '" . $device['device_id'] . "'"), 0);
if ($temp) { $datas[] = 'temp'; }
if ($temperatures) { $datas[] = 'temp'; }
if ($storage) { $datas[] = 'storage'; }
if ($memory) { $datas[] = 'memory'; }
if ($processor) { $datas[] = 'processors'; }
if ($fans) { $datas[] = 'fanspeeds'; }
if ($volts) { $datas[] = 'voltages'; }
$type_text['temp'] = "Temperatures";
$type_text['temperatures'] = "Temperatures";
$type_text['memory'] = "Memory Pools";
$type_text['storage'] = "Disk Usage";
$type_text['processors'] = "Processor Usage";
@@ -23,20 +23,26 @@ $type_text['fanspeeds'] = "Fan Speeds";
print_optionbar_start();
unset ($sep);
foreach ($datas as $type) {
if (!$_GET['opta']) { $_GET['opta'] = $type; }
echo($sep);
if ($_GET['opta'] == $type) { echo("<strong>"); }
if ($_GET['opta'] == $type) { echo(" | <strong>"); }
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/health/" . $type . "/'>" . $type_text[$type] ."</a>\n");
if ($_GET['opta'] == $type) { echo("</strong>"); }
$sep = ' | ';
}
unset ($sep);
print_optionbar_end();
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) { include("pages/device/health/".mres($_GET['opta']).".inc.php"); } else { echo("failed to open"); }
if (is_file("pages/device/health/".mres($_GET['opta']).".inc.php"))
{
include("pages/device/health/".mres($_GET['opta']).".inc.php");
} else {
foreach ($datas as $type) {
$graph_title = $type_text[$type];
$graph_type = "device_".$type;
include ("includes/print-device-graph.php");
}
}
?>