From 9abb874732ecd2e89c9715928cfa306e983234d6 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 16 Sep 2011 22:45:01 +0000 Subject: [PATCH] fix screenos memory git-svn-id: http://www.observium.org/svn/observer/trunk@2485 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 5 ++++- includes/discovery/mempools/screenos.inc.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index f653dc8a00..a95ea99ac1 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -271,10 +271,13 @@ STATE; function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background) { + + if($percent > "100") { $size_percent = "100"; } else { $size_percent = $percent; } + $output = '
-
+
'.$left_text.'
'.$right_text.'
diff --git a/includes/discovery/mempools/screenos.inc.php b/includes/discovery/mempools/screenos.inc.php index 5a7fc0f551..b10f1bb763 100755 --- a/includes/discovery/mempools/screenos.inc.php +++ b/includes/discovery/mempools/screenos.inc.php @@ -7,8 +7,8 @@ if ($device['os'] == "screenos") echo("ScreenOS: "); $used = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.1.0", "-OvQ"); - $total = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.2.0", "-OvQ"); - $free = $total - $used; + $free = snmp_get($device, ".1.3.6.1.4.1.3224.16.2.2.0", "-OvQ"); + $total = $free + $used; $percent = $used / $total * 100; @@ -17,4 +17,4 @@ if ($device['os'] == "screenos") discover_mempool($valid_mempool, $device, 0, "screenos", "Memory", "1", NULL, NULL); } } -?> \ No newline at end of file +?>