From dc1e291f1f2a8994502c958bda03131942bda954 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 15 Mar 2011 12:04:26 +0000 Subject: [PATCH] cleanup polling/mempools git-svn-id: http://www.observium.org/svn/observer/trunk@1842 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/polling/mempools/cemp.inc.php | 19 ++++++++++--------- includes/polling/mempools/cmp.inc.php | 19 ++++++++++--------- includes/polling/mempools/hpGlobal.inc.php | 11 ++++++++--- includes/polling/mempools/hpLocal.inc.php | 11 ++++++++--- includes/polling/mempools/hrstorage.inc.php | 11 ++++++++--- .../polling/mempools/ironware-dyn.inc.php | 13 ++++++------- includes/polling/mempools/junos.inc.php | 13 +++++++------ includes/polling/mempools/screenos.inc.php | 12 ++++++------ 8 files changed, 63 insertions(+), 46 deletions(-) diff --git a/includes/polling/mempools/cemp.inc.php b/includes/polling/mempools/cemp.inc.php index 5c1adcb967..2266578610 100755 --- a/includes/polling/mempools/cemp.inc.php +++ b/includes/polling/mempools/cemp.inc.php @@ -1,16 +1,17 @@ +?> \ No newline at end of file diff --git a/includes/polling/mempools/cmp.inc.php b/includes/polling/mempools/cmp.inc.php index 55ad416ae4..f7a3bd6cc8 100755 --- a/includes/polling/mempools/cmp.inc.php +++ b/includes/polling/mempools/cmp.inc.php @@ -1,16 +1,17 @@ +?> \ No newline at end of file diff --git a/includes/polling/mempools/hpGlobal.inc.php b/includes/polling/mempools/hpGlobal.inc.php index f47acad772..9402261f0c 100755 --- a/includes/polling/mempools/hpGlobal.inc.php +++ b/includes/polling/mempools/hpGlobal.inc.php @@ -8,10 +8,15 @@ # NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104 # NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728 -if(!is_array($mempool_cache['hpGlobal'])) { +if (!is_array($mempool_cache['hpGlobal'])) +{ $mempool_cache['hpGlobal'] = snmpwalk_cache_oid($device, "hpGlobal", NULL, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); if ($debug) { print_r($mempool_cache); } -} else { if($debug) { echo("Cached!"); } } +} +else +{ + if ($debug) { echo("Cached!"); } +} $entry = $mempool_cache['hpGlobal'][$mempool[mempool_index]]; @@ -20,4 +25,4 @@ $mempool['used'] = $entry['hpGlobalMemAllocBytes']; $mempool['total'] = $entry['hpGlobalMemTotalBytes']; $mempool['free'] = $entry['hpGlobalMemFreeBytes']; -?> +?> \ No newline at end of file diff --git a/includes/polling/mempools/hpLocal.inc.php b/includes/polling/mempools/hpLocal.inc.php index 0034d36e20..40647e8952 100644 --- a/includes/polling/mempools/hpLocal.inc.php +++ b/includes/polling/mempools/hpLocal.inc.php @@ -8,10 +8,15 @@ # NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669104 # NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668728 -if(!is_array($mempool_cache['hpLocal'])) { +if (!is_array($mempool_cache['hpLocal'])) +{ $mempool_cache['hpLocal'] = snmpwalk_cache_oid($device, "hpLocal", NULL, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp"); if ($debug) { print_r($mempool_cache); } -} else { if($debug) { echo("Cached!"); } } +} +else +{ + if ($debug) { echo("Cached!"); } +} $entry = $mempool_cache['hpLocal'][$mempool[mempool_index]]; @@ -20,4 +25,4 @@ $mempool['used'] = $entry['hpLocalMemAllocBytes']; $mempool['total'] = $entry['hpLocalMemTotalBytes']; $mempool['free'] = $entry['hpLocalMemFreeBytes']; -?> +?> \ No newline at end of file diff --git a/includes/polling/mempools/hrstorage.inc.php b/includes/polling/mempools/hrstorage.inc.php index 56b8510a09..45a6ae3b76 100755 --- a/includes/polling/mempools/hrstorage.inc.php +++ b/includes/polling/mempools/hrstorage.inc.php @@ -2,10 +2,15 @@ /// HOST-RESOURCES-MIB - Memory Objects -if(!is_array($storage_cache['hrstorage'])) { +if (!is_array($storage_cache['hrstorage'])) +{ $storage_cache['hrstorage'] = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); if ($debug) { print_r($storage_cache); } -} else { if($debug) { echo("Cached!"); } } +} +else +{ + if ($debug) { echo("Cached!"); } +} $entry = $storage_cache['hrstorage'][$mempool[mempool_index]]; @@ -14,4 +19,4 @@ $mempool['used'] = $entry['hrStorageUsed'] * $mempool['units']; $mempool['total'] = $entry['hrStorageSize'] * $mempool['units']; $mempool['free'] = $mempool['total'] - $mempool['used']; -?> +?> \ No newline at end of file diff --git a/includes/polling/mempools/ironware-dyn.inc.php b/includes/polling/mempools/ironware-dyn.inc.php index e4d8f56a2d..9f9db1fc99 100755 --- a/includes/polling/mempools/ironware-dyn.inc.php +++ b/includes/polling/mempools/ironware-dyn.inc.php @@ -1,11 +1,10 @@ +?> \ No newline at end of file diff --git a/includes/polling/mempools/junos.inc.php b/includes/polling/mempools/junos.inc.php index 92cb9fc7f0..7091320bfc 100755 --- a/includes/polling/mempools/junos.inc.php +++ b/includes/polling/mempools/junos.inc.php @@ -1,15 +1,16 @@ +?> \ No newline at end of file diff --git a/includes/polling/mempools/screenos.inc.php b/includes/polling/mempools/screenos.inc.php index f15a85018d..a9debd4a7d 100755 --- a/includes/polling/mempools/screenos.inc.php +++ b/includes/polling/mempools/screenos.inc.php @@ -1,10 +1,10 @@ +?> \ No newline at end of file