mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
Merge pull request #967 from laf/issue-963
Added support for NetApp detection + disks
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 958 B |
@@ -105,6 +105,12 @@ $config['os'][$os]['group'] = "unix";
|
||||
$config['os'][$os]['text'] = "QNAP TurboNAS";
|
||||
$config['os'][$os]['ifXmcbc'] = 1;
|
||||
|
||||
$os = "netapp";
|
||||
$config['os'][$os]['type'] = "storage";
|
||||
$config['os'][$os]['text'] = "NetApp";
|
||||
$config['os'][$os]['over'][0]['graph'] = "device_bits";
|
||||
$config['os'][$os]['over'][0]['text'] = "Device Traffic";
|
||||
|
||||
$os = "endian";
|
||||
$config['os'][$os]['text'] = "Endian";
|
||||
$config['os'][$os]['type'] = "firewall";
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!$os) {
|
||||
if (stristr($sysDescr, "NetApp")) {
|
||||
$os = "netapp";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
$netapp_storage = snmpwalk_cache_oid($device, "dfEntry",NULL, "NETAPP-MIB");
|
||||
|
||||
if (is_array($netapp_storage)) {
|
||||
echo "dfEntry ";
|
||||
foreach ($netapp_storage as $index => $storage) {
|
||||
$fstype = $storage['dfType'];
|
||||
$descr = $storage['dfFileSys'];
|
||||
$units = 1024;
|
||||
if (isset($storage['df64TotalKBytes']) && is_numeric($storage['df64TotalKBytes'])) {
|
||||
$size = $storage['df64TotalKBytes'] * $units;
|
||||
$used = $storage['df64UsedKBytes'] * $units;
|
||||
} else {
|
||||
$size = $storage['dfKBytesTotal'] * $units;
|
||||
$used = $storage['dfKBytesUsed'] * $units;
|
||||
}
|
||||
|
||||
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"); } }
|
||||
|
||||
if (!$deny && is_numeric($index)) {
|
||||
discover_storage($valid_storage, $device, $index, $fstype, "netapp-storage", $descr, $size , $units, $used);
|
||||
}
|
||||
unset($deny, $fstype, $descr, $size, $used, $units, $storage_rrd, $old_storage_rrd, $hrstorage_array);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
$serial = snmp_get($device, "productSerialNum.0", "-Ovq", "NETAPP-MIB");
|
||||
$hardware = snmp_get($device, "productModel.0", "-Ovq", "NETAPP-MIB");
|
||||
list($version,) = split(":", snmp_get($device, "productVersion.0", "-Ovq", "NETAPP-MIB"));
|
||||
$version = str_replace("NetApp Release ", "", $version);
|
||||
@@ -13,7 +13,7 @@ foreach (dbFetchRows("SELECT * FROM storage WHERE device_id = ?", array($device[
|
||||
rrdtool_create($storage_rrd, "--step 300 DS:used:GAUGE:600:0:U DS:free:GAUGE:600:0:U ".$config['rrd_rra']);
|
||||
}
|
||||
|
||||
$file = $config['install_dir']."/includes/polling/storage-".$storage['storage_mib'].".inc.php";
|
||||
$file = $config['install_dir']."/includes/polling/storage/".$storage['storage_mib'].".inc.php";
|
||||
if (is_file($file))
|
||||
{
|
||||
include($file);
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (!is_array($storage_cache['netapp-storage'])) {
|
||||
$storage_cache['netapp-storage'] = snmpwalk_cache_oid($device, "dfEntry", NULL, "NETAPP-MIB");
|
||||
if ($debug) {
|
||||
print_r($storage_cache);
|
||||
}
|
||||
}
|
||||
|
||||
$entry = $storage_cache['netapp-storage'][$storage[storage_index]];
|
||||
|
||||
$storage['units'] = 1024;
|
||||
if (isset($entry['df64TotalKBytes']) && is_numeric($entry['df64TotalKBytes'])) {
|
||||
$storage['used'] = $entry['df64UsedKBytes'] * $storage['units'];
|
||||
$storage['size'] = $entry['df64TotalKBytes'] * $storage['units'];
|
||||
} else {
|
||||
$storage['used'] = $entry['dfKBytesUsed'] * $storage['units'];
|
||||
$storage['size'] = $entry['dfKBytesTotal'] * $storage['units'];
|
||||
}
|
||||
$storage['free'] = $storage['size'] - $storage['used'];
|
||||
+33851
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user