mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Merge pull request #3051 from vrillusions/apc-bank-count
apc discovery: Get a count of banks before pulling info
This commit is contained in:
		@@ -58,7 +58,10 @@ if ($device['os'] == 'apc') {
 | 
			
		||||
    unset($oids);
 | 
			
		||||
 | 
			
		||||
    // v2 firmware- first bank is total, v3 firmware, 3rd bank is total
 | 
			
		||||
    $oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
 | 
			
		||||
    $bank_count = snmp_get($device, 'rPDULoadDevNumBanks.0', '-Oqv', 'PowerNet-MIB');
 | 
			
		||||
    if ($bank_count > 0) {
 | 
			
		||||
        $oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
 | 
			
		||||
    }
 | 
			
		||||
    // should work with firmware v2 and v3
 | 
			
		||||
    if ($oids) {
 | 
			
		||||
        echo 'APC PowerNet-MIB Banks ';
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user