From 81eb203abebb01e82904574fdc66eeb8ce9a6a26 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 25 Feb 2010 00:56:13 +0000 Subject: [PATCH] storage fixes, moving things from graphing page, ironware dynamic memory pool (static!) git-svn-id: http://www.observium.org/svn/observer/trunk@947 61d68cd4-352d-0410-923a-c4978735b2b8 --- .../includes/graphs/device_processors.inc.php | 36 ++++++++++++ html/includes/graphs/device_storage.inc.php | 2 +- html/includes/graphs/device_voltages.inc.php | 55 +++++++++++++++++++ html/includes/graphs/storage.inc.php | 2 +- html/pages/device/graphs/os-ios.inc.php | 6 +- html/pages/device/graphs/os-ironware.inc.php | 2 +- html/pages/device/graphs/os-junos.inc.php | 4 +- html/pages/device/graphs/os-junose.inc.php | 5 +- html/pages/device/graphs/os-unix.inc.php | 1 - html/pages/device/graphs/os-windows.inc.php | 2 - html/pages/device/graphs/temperatures.inc.php | 7 --- html/pages/device/health.inc.php | 13 +++-- .../discovery/mempools-ironware-dyn.inc.php | 16 ++++++ includes/discovery/mempools.inc.php | 1 + .../polling/mempools-ironware-dyn.inc.php | 9 +++ includes/polling/mempools.inc.php | 5 +- includes/polling/storage.inc.php | 2 +- 17 files changed, 138 insertions(+), 30 deletions(-) create mode 100644 html/includes/graphs/device_processors.inc.php create mode 100644 html/includes/graphs/device_voltages.inc.php delete mode 100644 html/pages/device/graphs/temperatures.inc.php create mode 100755 includes/discovery/mempools-ironware-dyn.inc.php create mode 100755 includes/polling/mempools-ironware-dyn.inc.php diff --git a/html/includes/graphs/device_processors.inc.php b/html/includes/graphs/device_processors.inc.php new file mode 100644 index 000000000..728e28e61 --- /dev/null +++ b/html/includes/graphs/device_processors.inc.php @@ -0,0 +1,36 @@ + diff --git a/html/includes/graphs/device_storage.inc.php b/html/includes/graphs/device_storage.inc.php index 55a949d6d..976175241 100644 --- a/html/includes/graphs/device_storage.inc.php +++ b/html/includes/graphs/device_storage.inc.php @@ -14,7 +14,7 @@ include("common.inc.php"); } elseif($iter=="7") {$colour="FF0084"; $iter = "0"; } $descr = substr(str_pad($storage[storage_descr], 12),0,12); $descr = str_replace(":","\:",$descr); - $rrd = $config['rrd_dir'] . "/$hostname/" . safename("storage-".$storage['storage_mib']."-".$storage['storage_index'].".rrd"); + $rrd = $config['rrd_dir'] . "/$hostname/" . safename("storage-".$storage['storage_mib']."-".$storage['storage_descr'].".rrd"); $rrd_options .= " DEF:$storage[storage_id]used=$rrd:used:AVERAGE"; $rrd_options .= " DEF:$storage[storage_id]free=$rrd:free:AVERAGE"; $rrd_options .= " CDEF:$storage[storage_id]size=$storage[storage_id]used,$storage[storage_id]free,+"; diff --git a/html/includes/graphs/device_voltages.inc.php b/html/includes/graphs/device_voltages.inc.php new file mode 100644 index 000000000..91727ee90 --- /dev/null +++ b/html/includes/graphs/device_voltages.inc.php @@ -0,0 +1,55 @@ + diff --git a/html/includes/graphs/storage.inc.php b/html/includes/graphs/storage.inc.php index 1e525f5f6..a94673879 100644 --- a/html/includes/graphs/storage.inc.php +++ b/html/includes/graphs/storage.inc.php @@ -17,7 +17,7 @@ $rrd_options .= " -b 1024"; } elseif($iter=="7") {$colour="FF0084"; $iter = "0"; } $descr = substr(str_pad($storage[storage_descr], 12),0,12); $descr = str_replace(":","\:",$descr); - $rrd = $config['rrd_dir'] . "/" . $hostname . "/" . safename("storage-" . $storage['storage_mib'] . "-" . $storage['storage_index'] . ".rrd"); + $rrd = $config['rrd_dir'] . "/" . $hostname . "/" . safename("storage-" . $storage['storage_mib'] . "-" . $storage['storage_descr'] . ".rrd"); $rrd_options .= " DEF:$storage[storage_id]used=$rrd:used:AVERAGE"; $rrd_options .= " DEF:$storage[storage_id]free=$rrd:free:AVERAGE"; $rrd_options .= " CDEF:$storage[storage_id]size=$storage[storage_id]used,$storage[storage_id]free,+"; diff --git a/html/pages/device/graphs/os-ios.inc.php b/html/pages/device/graphs/os-ios.inc.php index 3d429b1e7..42532d915 100644 --- a/html/pages/device/graphs/os-ios.inc.php +++ b/html/pages/device/graphs/os-ios.inc.php @@ -1,8 +1,8 @@ diff --git a/html/pages/device/graphs/os-junose.inc.php b/html/pages/device/graphs/os-junose.inc.php index 69e35f758..c464742a3 100644 --- a/html/pages/device/graphs/os-junose.inc.php +++ b/html/pages/device/graphs/os-junose.inc.php @@ -1,6 +1,7 @@ diff --git a/html/pages/device/graphs/os-unix.inc.php b/html/pages/device/graphs/os-unix.inc.php index 6636eacc0..4a0979348 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("temperatures.inc.php"); include("netstats.inc.php"); include("laload.inc.php"); include("hrusers.inc.php"); diff --git a/html/pages/device/graphs/os-windows.inc.php b/html/pages/device/graphs/os-windows.inc.php index 6636eacc0..b71039eee 100644 --- a/html/pages/device/graphs/os-windows.inc.php +++ b/html/pages/device/graphs/os-windows.inc.php @@ -1,8 +1,6 @@ "); -} -?> diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php index d885e5244..0a7cf1bff 100644 --- a/html/pages/device/health.inc.php +++ b/html/pages/device/health.inc.php @@ -7,10 +7,10 @@ $processor = mysql_result(mysql_query("select count(*) from processors WHERE de $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 ($temperatures) { $datas[] = 'temp'; } -if ($storage) { $datas[] = 'storage'; } -if ($memory) { $datas[] = 'memory'; } if ($processor) { $datas[] = 'processors'; } +if ($memory) { $datas[] = 'memory'; } +if ($storage) { $datas[] = 'storage'; } +if ($temperatures) { $datas[] = 'temperatures'; } if ($fans) { $datas[] = 'fanspeeds'; } if ($volts) { $datas[] = 'voltages'; } @@ -23,11 +23,14 @@ $type_text['fanspeeds'] = "Fan Speeds"; print_optionbar_start(); +if(!$_GET['opta']) { echo(""); } +echo("Main\n"); +if(!$_GET['opta']) { echo(""); } foreach ($datas as $type) { - if ($_GET['opta'] == $type) { echo(" | "); } - echo("" . $type_text[$type] ."\n"); + if ($_GET['opta'] == $type) { echo(""); } + echo(" | " . $type_text[$type] ."\n"); if ($_GET['opta'] == $type) { echo(""); } } diff --git a/includes/discovery/mempools-ironware-dyn.inc.php b/includes/discovery/mempools-ironware-dyn.inc.php new file mode 100755 index 000000000..22766f19e --- /dev/null +++ b/includes/discovery/mempools-ironware-dyn.inc.php @@ -0,0 +1,16 @@ + diff --git a/includes/discovery/mempools.inc.php b/includes/discovery/mempools.inc.php index bc0a635a0..8c6255342 100755 --- a/includes/discovery/mempools.inc.php +++ b/includes/discovery/mempools.inc.php @@ -3,6 +3,7 @@ echo("Memory : "); include("mempools-cmp.inc.php"); +include("mempools-ironware-dyn.inc.php"); ### Remove memory pools which weren't redetected here diff --git a/includes/polling/mempools-ironware-dyn.inc.php b/includes/polling/mempools-ironware-dyn.inc.php new file mode 100755 index 000000000..bf8c46329 --- /dev/null +++ b/includes/polling/mempools-ironware-dyn.inc.php @@ -0,0 +1,9 @@ + diff --git a/includes/polling/mempools.inc.php b/includes/polling/mempools.inc.php index eaa1d8d2f..728650086 100755 --- a/includes/polling/mempools.inc.php +++ b/includes/polling/mempools.inc.php @@ -28,16 +28,13 @@ while($mempool = mysql_fetch_array($mempool_data)) { } $file = $config['install_dir']."/includes/polling/mempools-".$mempool['mempool_type'].".inc.php"; - echo($file); if(is_file($file)) { include($file); } else { ### FIXME GENERIC } - $percent = $mempool['used'] * $mempool['total'] * 100; - - print_r($mempool); + $percent = round($mempool['used'] * $mempool['total'] * 100); echo($percent."% "); diff --git a/includes/polling/storage.inc.php b/includes/polling/storage.inc.php index f4d029eab..1130f4707 100755 --- a/includes/polling/storage.inc.php +++ b/includes/polling/storage.inc.php @@ -8,7 +8,7 @@ while($storage = mysql_fetch_array($storage_data)) { echo($storage['storage_descr'] . ": "); - $storage_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("storage-" . $storage['storage_mib'] . "-" . $storage['storage_index'] . ".rrd"); + $storage_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("storage-" . $storage['storage_mib'] . "-" . safename($storage['storage_descr']) . ".rrd"); if (!is_file($storage_rrd)) { rrdtool_create($storage_rrd, "--step 300 \