Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Nimble storage volume utilization #8405

Merged
merged 4 commits into from Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions includes/definitions/nimbleos.yaml
Expand Up @@ -6,6 +6,8 @@ over:
- { graph: device_bits, text: 'Device Traffic' }
- { graph: device_processor, text: 'Processor Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
mib_dir:
- nimble
discovery:
- sysDescr:
- Nimble Storage
41 changes: 41 additions & 0 deletions includes/discovery/storage/nimbleos.inc.php
@@ -0,0 +1,41 @@
<?php
/**
* nimbleos.inc.php
*
* LibreNMS storage discovery module for Nimble Storage
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2018 theherodied
* @author https://github.com/theherodied/
*/
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);
}
}
33 changes: 33 additions & 0 deletions includes/polling/storage/nimbleos.inc.php
@@ -0,0 +1,33 @@
<?php
/**
* nimbleos.inc.php
*
* LibreNMS storage discovery module for Nimble Storage
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2018 theherodied
* @author https://github.com/theherodied/
*/
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']);