From 17fe4219c211ff016920ceadb26ae951b8e182c3 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 24 Feb 2010 21:44:32 +0000 Subject: [PATCH] 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 --- html/includes/graphs/device_hrstorage.inc.php | 29 ------------------ html/includes/graphs/device_storage.inc.php | 30 +++++++++++++++++++ html/includes/graphs/port_etherlike.inc.php | 13 ++++---- html/pages/device/graphs/os-unix.inc.php | 1 - html/pages/device/graphs/os-windows.inc.php | 1 - .../{hrstorage.inc.php => storage.inc.php} | 2 +- html/pages/device/health.inc.php | 26 +++++++++------- .../{temp.inc.php => temperatures.inc.php} | 0 8 files changed, 54 insertions(+), 48 deletions(-) delete mode 100644 html/includes/graphs/device_hrstorage.inc.php create mode 100644 html/includes/graphs/device_storage.inc.php rename html/pages/device/graphs/{hrstorage.inc.php => storage.inc.php} (83%) rename html/pages/device/health/{temp.inc.php => temperatures.inc.php} (100%) diff --git a/html/includes/graphs/device_hrstorage.inc.php b/html/includes/graphs/device_hrstorage.inc.php deleted file mode 100644 index cca571825..000000000 --- a/html/includes/graphs/device_hrstorage.inc.php +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/html/includes/graphs/device_storage.inc.php b/html/includes/graphs/device_storage.inc.php new file mode 100644 index 000000000..55a949d6d --- /dev/null +++ b/html/includes/graphs/device_storage.inc.php @@ -0,0 +1,30 @@ + diff --git a/html/includes/graphs/port_etherlike.inc.php b/html/includes/graphs/port_etherlike.inc.php index 8288eeb8f..4c210af25 100644 --- a/html/includes/graphs/port_etherlike.inc.php +++ b/html/includes/graphs/port_etherlike.inc.php @@ -2,8 +2,7 @@ ## Generate a list of ports and then call the multi_bits grapher to generate from the list -$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.interface_id = '".mres($_GET['port'])."' - AND I.device_id = D.device_id"); +$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.interface_id = '".mres($_GET['port'])."' AND I.device_id = D.device_id"); $port = mysql_fetch_array($query); $oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingleCollisionFrames', 'dot3StatsMultipleCollisionFrames', @@ -12,17 +11,19 @@ $oids = array('dot3StatsAlignmentErrors', 'dot3StatsFCSErrors', 'dot3StatsSingle 'dot3StatsSymbolErrors'); $i=0; -if(is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/" . safename("etherlike-" . $port['ifIndex'] . ".rrd"))) { +$file = $config['rrd_dir'] . "/" . $port['hostname'] . "/" . safename("etherlike-" . $port['ifIndex'] . ".rrd"); +if(is_file($file)) { foreach($oids as $oid){ $oid = str_replace("dot3Stats", "", $oid); $oid_rra = truncate($oid, 19, ''); - $rrd_create .= " DS:$oid:COUNTER:600:U:100000000000"; - $rrd_list[$i]['filename'] = $config['rrd_dir'] . "/" . $port['hostname'] . "/" . safename("etherlike-" . $port['ifIndex'] . ".rrd"); + $rrd_list[$i]['filename'] = $file; $rrd_list[$i]['descr'] = $oid; $rrd_list[$i]['rra'] = $oid_rra; $i++; } -} +} else {echo("file missing: $file"); } + +print_r($rrd_list); $colours = "mixed"; $nototal = 1; diff --git a/html/pages/device/graphs/os-unix.inc.php b/html/pages/device/graphs/os-unix.inc.php index bcaeebac2..6636eacc0 100644 --- a/html/pages/device/graphs/os-unix.inc.php +++ b/html/pages/device/graphs/os-unix.inc.php @@ -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"); diff --git a/html/pages/device/graphs/os-windows.inc.php b/html/pages/device/graphs/os-windows.inc.php index bcaeebac2..6636eacc0 100644 --- a/html/pages/device/graphs/os-windows.inc.php +++ b/html/pages/device/graphs/os-windows.inc.php @@ -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"); diff --git a/html/pages/device/graphs/hrstorage.inc.php b/html/pages/device/graphs/storage.inc.php similarity index 83% rename from html/pages/device/graphs/hrstorage.inc.php rename to html/pages/device/graphs/storage.inc.php index dc1586d3d..a7369a6cb 100644 --- a/html/pages/device/graphs/hrstorage.inc.php +++ b/html/pages/device/graphs/storage.inc.php @@ -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"); } diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php index f49724602..d885e5244 100644 --- a/html/pages/device/health.inc.php +++ b/html/pages/device/health.inc.php @@ -1,20 +1,20 @@ "); } + if ($_GET['opta'] == $type) { echo(" | "); } echo("" . $type_text[$type] ."\n"); if ($_GET['opta'] == $type) { echo(""); } - $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"); + } +} ?> diff --git a/html/pages/device/health/temp.inc.php b/html/pages/device/health/temperatures.inc.php similarity index 100% rename from html/pages/device/health/temp.inc.php rename to html/pages/device/health/temperatures.inc.php