mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix Novel Netware memory/storage detection (missing storage for now, but atleast memory is in the memory section, not storage!)
git-svn-id: http://www.observium.org/svn/observer/trunk@2156 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
global $valid_mempool;
|
||||
|
||||
$storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
|
||||
$storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES:NetWare-Host-Ext-MIB");
|
||||
|
||||
if (is_array($storage_array))
|
||||
{
|
||||
@ -16,7 +16,26 @@ if (is_array($storage_array))
|
||||
$units = $storage['hrStorageAllocationUnits'];
|
||||
$deny = 1;
|
||||
|
||||
if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam") { $deny = 0; }
|
||||
switch($fstype)
|
||||
{
|
||||
case 'hrStorageVirtualMemory':
|
||||
case 'hrStorageRam';
|
||||
case 'nwhrStorageDOSMemory';
|
||||
case 'nwhrStorageMemoryAlloc';
|
||||
case 'nwhrStorageMemoryPermanent';
|
||||
case 'nwhrStorageMemoryAlloc';
|
||||
case 'nwhrStorageCacheBuffers';
|
||||
case 'nwhrStorageCacheMovable';
|
||||
case 'nwhrStorageCacheNonMovable';
|
||||
case 'nwhrStorageCodeAndDataMemory';
|
||||
case 'nwhrStorageDOSMemory';
|
||||
case 'nwhrStorageIOEngineMemory';
|
||||
case 'nwhrStorageMSEngineMemory';
|
||||
case 'nwhrStorageUnclaimedMemory';
|
||||
$deny = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($device['os'] == "routeros" && $descr == "main memory") { $deny = 0; }
|
||||
|
||||
if (strstr($descr, "MALLOC") || strstr($descr, "UMA")) { $deny = 1; } ## Ignore FreeBSD INSANITY
|
||||
@ -34,4 +53,4 @@ if (is_array($storage_array))
|
||||
unset($storage_array);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
echo("Storage : ");
|
||||
|
||||
include("storage-hrstorage.inc.php");
|
||||
include_dir("includes/discovery/storage");
|
||||
|
||||
|
||||
### Remove storage which weren't redetected here
|
||||
|
||||
@ -29,4 +30,4 @@ while ($test_storage = mysql_fetch_assoc($query))
|
||||
unset($valid_storage);
|
||||
echo("\n");
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -1,11 +1,13 @@
|
||||
<?php
|
||||
|
||||
$storage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
|
||||
$hrstorage_array = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES:NetWare-Host-Ext-MIB");
|
||||
|
||||
if (is_array($storage_array))
|
||||
global $valid_storage;
|
||||
|
||||
if (is_array($hrstorage_array))
|
||||
{
|
||||
echo("hrStorage : ");
|
||||
foreach ($storage_array as $index => $storage)
|
||||
foreach ($hrstorage_array as $index => $storage)
|
||||
{
|
||||
$fstype = $storage['hrStorageType'];
|
||||
$descr = $storage['hrStorageDescr'];
|
||||
@ -13,6 +15,28 @@ if (is_array($storage_array))
|
||||
$used = $storage['hrStorageUsed'] * $storage['hrStorageAllocationUnits'];
|
||||
$units = $storage['hrStorageAllocationUnits'];
|
||||
|
||||
switch($fstype)
|
||||
{
|
||||
case 'hrStorageVirtualMemory':
|
||||
case 'hrStorageRam';
|
||||
case 'hrStorageOther';
|
||||
case 'nwhrStorageDOSMemory';
|
||||
case 'nwhrStorageMemoryAlloc';
|
||||
case 'nwhrStorageMemoryPermanent';
|
||||
case 'nwhrStorageMemoryAlloc';
|
||||
case 'nwhrStorageCacheBuffers';
|
||||
case 'nwhrStorageCacheMovable';
|
||||
case 'nwhrStorageCacheNonMovable';
|
||||
case 'nwhrStorageCodeAndDataMemory';
|
||||
case 'nwhrStorageDOSMemory';
|
||||
case 'nwhrStorageIOEngineMemory';
|
||||
case 'nwhrStorageMSEngineMemory';
|
||||
case 'nwhrStorageUnclaimedMemory';
|
||||
$deny = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
foreach ($config['ignore_mount'] as $bi) { if ($bi == $descr) { $deny = 1; if ($debug) echo("$bi == $descr \n"); } }
|
||||
foreach ($config['ignore_mount_string'] as $bi) { if (strpos($descr, $bi) !== FALSE) { $deny = 1; if ($debug) echo("strpos: $descr, $bi \n"); } }
|
||||
foreach ($config['ignore_mount_regexp'] as $bi) { if (preg_match($bi, $descr) > "0") { $deny = 1; if ($debug) echo("preg_match $bi, $descr \n"); } }
|
||||
@ -20,7 +44,6 @@ if (is_array($storage_array))
|
||||
if (isset($config['ignore_mount_removable']) && $config['ignore_mount_removable'] && $fstype == "hrStorageRemovableDisk") { $deny = 1; if ($debug) echo("skip(removable)\n"); }
|
||||
if (isset($config['ignore_mount_network']) && $config['ignore_mount_network'] && $fstype == "hrStorageNetworkDisk") { $deny = 1; if ($debug) echo("skip(network)\n"); }
|
||||
if (isset($config['ignore_mount_optical']) && $config['ignore_mount_optical'] && $fstype == "hrStorageCompactDisc") { $deny = 1; if ($debug) echo("skip(cd)\n"); }
|
||||
if ($fstype == "hrStorageVirtualMemory" || $fstype == "hrStorageRam" || $fstype == "hrStorageOther") { $deny = 1; }
|
||||
|
||||
if (!$deny && is_numeric($index))
|
||||
{
|
||||
@ -31,9 +54,9 @@ if (is_array($storage_array))
|
||||
#$storage_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("storage-hrstorage-" . $index . ".rrd");
|
||||
#if (is_file($old_storage_rrd)) { rename($old_storage_rrd,$storage_rrd); }
|
||||
|
||||
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $storage_array);
|
||||
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $hrstorage_array);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
1094
mibs/NetWare-Host-Ext-MIB
Normal file
1094
mibs/NetWare-Host-Ext-MIB
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user