mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Added netapp storage support and restructured storage files/dir
This commit is contained in:
		
							
								
								
									
										28
									
								
								includes/discovery/storage/netapp-storage.inc.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								includes/discovery/storage/netapp-storage.inc.php
									
									
									
									
									
										Normal file
									
								
							@@ -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);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user