From 7087782cdbca76390f07266927654d55f5374ecd Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Fri, 12 Mar 2010 18:13:30 +0000 Subject: [PATCH] toner graphing git-svn-id: http://www.observium.org/svn/observer/trunk@1016 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/graphs/device_toner.inc.php | 55 +++++++++++++++++++++++ html/pages/device.php | 2 +- html/pages/device/toner.inc.php | 8 ++++ includes/discovery/toner.inc.php | 1 + includes/polling/toner.inc.php | 2 +- 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 html/includes/graphs/device_toner.inc.php create mode 100644 html/pages/device/toner.inc.php diff --git a/html/includes/graphs/device_toner.inc.php b/html/includes/graphs/device_toner.inc.php new file mode 100644 index 000000000..affb7b8fa --- /dev/null +++ b/html/includes/graphs/device_toner.inc.php @@ -0,0 +1,55 @@ + diff --git a/html/pages/device.php b/html/pages/device.php index 7a2007bd0..2db2c1edf 100644 --- a/html/pages/device.php +++ b/html/pages/device.php @@ -160,7 +160,7 @@ if(mysql_result(mysql_query("select count(service_id) from services WHERE device if(@mysql_result(mysql_query("select count(toner_id) from toner WHERE device_id = '" . $device['device_id'] . "'"), 0) > '0') { echo('
  • - Toner + Toner
  • '); } diff --git a/html/pages/device/toner.inc.php b/html/pages/device/toner.inc.php new file mode 100644 index 000000000..b8f83de26 --- /dev/null +++ b/html/pages/device/toner.inc.php @@ -0,0 +1,8 @@ + + diff --git a/includes/discovery/toner.inc.php b/includes/discovery/toner.inc.php index 4f499389e..226f6fcd3 100644 --- a/includes/discovery/toner.inc.php +++ b/includes/discovery/toner.inc.php @@ -32,6 +32,7 @@ if ($device['os'] == "dell-laser") $descr = str_replace('"','',snmp_get($device, $descr_oid, "-Oqv")); $current = snmp_get($device, $toner_oid, "-Oqv"); $capacity = snmp_get($device, $capacity_oid, "-Oqv"); + $current = $current / $capacity * 100; $type = "dell-laser"; echo discover_toner($device, $toner_oid, $index, $type, $descr, $capacity, $current); $toner_exists[$type][$index] = 1; diff --git a/includes/polling/toner.inc.php b/includes/polling/toner.inc.php index ab403dad6..6ada03c9e 100755 --- a/includes/polling/toner.inc.php +++ b/includes/polling/toner.inc.php @@ -1,6 +1,6 @@