Last active
March 16, 2018 17:25
-
-
Save theherodied/de8c264c39b8b5e906f2931a8da01aaf to your computer and use it in GitHub Desktop.
Librenms Nimble Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use LibreNMS\Config; | |
$nimble_storage = snmpwalk_cache_oid($device, 'volEntry', null, 'NIMBLE-MIB'); | |
if (is_array($nimble_storage)) { | |
echo 'volEntry '; | |
foreach ($nimble_storage as $index => $storage) { | |
$units = 1024*1024; | |
$fstype = $storage['volOnline']; | |
$descr = $storage['volName']; | |
$size = $storage['volSizeLow'] * $units; | |
$used = $storage['volUsageLow'] * $units; | |
if (is_numeric($index)) { | |
discover_storage($valid_storage, $device, $index, $fstype, 'nimbleos', $descr, $size, $units, $used); | |
} | |
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $hrstorage_array); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!is_array($storage_cache['nimbleos'])) { | |
$storage_cache['nimbleos'] = snmpwalk_cache_oid($device, 'volEntry', null, 'NIMBLE-MIB'); | |
d_echo($storage_cache); | |
} | |
$entry = $storage_cache['nimbleos'][$storage[storage_index]]; | |
$storage['units'] = 1024*1024; | |
$storage['size'] = ($entry['volSizeLow'] * $storage['units']); | |
$storage['used'] = ($entry['volUsageLow'] * $storage['units']); | |
$storage['free'] = ($storage['size'] - $storage['used']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Librenms Pull Request | |
https://github.com/librenms/librenms/pull/8405 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment