mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	It's also possible to do zpool IO from the MIB, but diskIO on LibreNMS makes a lot of assumptions about it coming from the UCD MIB. This changeset adds detection for FreeNAS and TrueNAS - despite having their own enterprise number, the snmpd uses the FreeBSD one. The naming is a bit all over the place, because this reflects reality - IXSystems produce FreeNAS and TrueNAS, the product lines have merged to eliminate FreeNAS, but TrueNAS still calls itself FreeNAS everywhere except the GUI.
		
			
				
	
	
		
			14 lines
		
	
	
		
			528 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			528 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| if (!is_array($storage_cache['dataset'])) {
 | |
|     $storage_cache['dataset'] = snmpwalk_cache_oid($device, 'datasetTable', null, 'FREENAS-MIB');
 | |
|     d_echo($storage_cache);
 | |
| }
 | |
| 
 | |
| foreach ($storage_cache['dataset'] as $index => $entry) {
 | |
|     $storage['units']       = $entry['datasetAllocationUnits'];
 | |
|     $storage['size']        = ($entry['datasetSize'] * $storage['units']);
 | |
|     $storage['free']        = ($entry['datasetAvailable'] * $storage['units']);
 | |
|     $storage['used']        = ($storage['size'] - $storage['free']);
 | |
| }
 |