mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
HP Procurve mempool polling&discovery (we discover both hpLocal and hpGlobal for now, though i see little realistic difference between them on most devices)
git-svn-id: http://www.observium.org/svn/observer/trunk@1539 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
39
includes/discovery/mempools/hp-procurve.inc.php
Executable file
39
includes/discovery/mempools/hp-procurve.inc.php
Executable file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
#NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
|
||||
#NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
|
||||
#NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
|
||||
#NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803
|
||||
#NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704
|
||||
#NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669100
|
||||
#NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668732
|
||||
|
||||
#NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
|
||||
#NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
|
||||
#NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
|
||||
#NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
|
||||
#NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
|
||||
#NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
|
||||
#NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728
|
||||
|
||||
$array = snmpwalk_cache_oid($device, "hpLocal", NULL, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp");
|
||||
$array = snmpwalk_cache_oid($device, "hpGlobal", $array, "NETSWITCH-MIB", $config['mibdir'].":".$config['mibdir']."/hp");
|
||||
|
||||
if(is_array($array)) {
|
||||
echo("procurve : ");
|
||||
foreach($array[$device[device_id]] as $index => $mempool)
|
||||
{
|
||||
if(is_numeric($index) && is_numeric($mempool['hpLocalMemTotalBytes'])) {
|
||||
discover_mempool($valid_mempool, $device, $index, "hpLocal", "Local Memory ".$index, NULL, NULL, NULL);
|
||||
}
|
||||
if(is_numeric($index) && is_numeric($mempool['hpGlobalMemTotalBytes'])) {
|
||||
discover_mempool($valid_mempool, $device, $index, "hpGlobal", "Global Memory ".$index, NULL, NULL, NULL);
|
||||
}
|
||||
unset($deny, $fstype, $descr, $size, $used, $units);
|
||||
}
|
||||
unset($array);
|
||||
}
|
||||
|
||||
?>
|
23
includes/polling/mempools/hpGlobal.inc.php
Executable file
23
includes/polling/mempools/hpGlobal.inc.php
Executable file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
# NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
|
||||
# NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
|
||||
# NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
|
||||
# NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
|
||||
# NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
|
||||
# NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
|
||||
# NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728
|
||||
|
||||
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!"); } }
|
||||
|
||||
$entry = $mempool_cache['hpGlobal'][$device[device_id]][$mempool[mempool_index]];
|
||||
|
||||
$mempool['units'] = "1";
|
||||
$mempool['used'] = $entry['hpGlobalMemAllocBytes'];
|
||||
$mempool['total'] = $entry['hpGlobalMemTotalBytes'];
|
||||
$mempool['free'] = $entry['hpGlobalMemFreeBytes'];
|
||||
|
||||
?>
|
23
includes/polling/mempools/hpLocal.inc.php
Normal file
23
includes/polling/mempools/hpLocal.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
# NETSWITCH-MIB::hpLocalMemSlotIndex.1 = INTEGER: 1
|
||||
# NETSWITCH-MIB::hpLocalMemSlabCnt.1 = Counter32: 3966
|
||||
# NETSWITCH-MIB::hpLocalMemFreeSegCnt.1 = Counter32: 166
|
||||
# NETSWITCH-MIB::hpLocalMemAllocSegCnt.1 = Counter32: 3803
|
||||
# NETSWITCH-MIB::hpLocalMemTotalBytes.1 = INTEGER: 11337704
|
||||
# NETSWITCH-MIB::hpLocalMemFreeBytes.1 = INTEGER: 9669104
|
||||
# NETSWITCH-MIB::hpLocalMemAllocBytes.1 = INTEGER: 1668728
|
||||
|
||||
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!"); } }
|
||||
|
||||
$entry = $mempool_cache['hpLocal'][$device[device_id]][$mempool[mempool_index]];
|
||||
|
||||
$mempool['units'] = "1";
|
||||
$mempool['used'] = $entry['hpLocalMemAllocBytes'];
|
||||
$mempool['total'] = $entry['hpLocalMemTotalBytes'];
|
||||
$mempool['free'] = $entry['hpLocalMemFreeBytes'];
|
||||
|
||||
?>
|
@ -267,7 +267,8 @@ $config['os'][$os]['type'] = "network";
|
||||
$config['os'][$os]['icon'] = "hp";
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][0]['text'] = "Traffic";
|
||||
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_processors";
|
||||
$config['os'][$os]['over'][0]['text'] = "CPU Usage";
|
||||
|
||||
$os = "speedtouch";
|
||||
$config['os'][$os]['text'] = "Thomson Speedtouch";
|
||||
|
Reference in New Issue
Block a user