mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	git-svn-id: http://www.observium.org/svn/observer/trunk@1318 61d68cd4-352d-0410-923a-c4978735b2b8
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <?php
 | |
| 
 | |
|   if($device['os'] == "ironware" || $device['os_group'] == "ironware")
 | |
|   {
 | |
|     echo("IronWare : ");
 | |
|     $processors_array = snmpwalk_cache_triple_oid($device, "snAgentCpuUtilEntry", $processors_array, "FOUNDRY-SN-AGENT-MIB");
 | |
|     if($debug) { print_r($processors_array); }
 | |
|     foreach($processors_array[$device['device_id']] as $index => $entry) 
 | |
|     {
 | |
|       if (($entry['snAgentCpuUtilValue'] || $entry['snAgentCpuUtil100thPercent']) && $entry['snAgentCpuUtilInterval'] == "300") 
 | |
|       {
 | |
|         #$entPhysicalIndex = $entry['cpmCPUTotalPhysicalIndex'];
 | |
| 
 | |
|         if($entry['snAgentCpuUtil100thPercent']) {
 | |
|           $usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.6." . $index;
 | |
|           $usage = $entry['snAgentCpuUtil100thPercent'];
 | |
| 	  $precision = 100;
 | |
|         } elseif($entry['snAgentCpuUtilValue']) {
 | |
|           $usage_oid = ".1.3.6.1.4.1.1991.1.1.2.11.1.1.4." . $index;
 | |
|           $usage = $entry['snAgentCpuUtilValue'];
 | |
|           $precision = 100;
 | |
|         }
 | |
| 
 | |
|         list($slot, $instance, $interval) = explode(".", $index);
 | |
| 
 | |
|         $descr_oid = "snAgentConfigModuleDescription." . $entry['snAgentCpuUtilSlotNum'];
 | |
|         $descr = snmp_get($device, $descr_oid, "-Oqv", "FOUNDRY-SN-AGENT-MIB");
 | |
|         $descr = str_replace("\"", "", $descr);
 | |
| 	list($descr) = explode(" ", $descr);
 | |
| 
 | |
|         $descr = "Slot " . $entry['snAgentCpuUtilSlotNum'] . " " . $descr;
 | |
|         $descr = $descr . " [".$instance."]";
 | |
| 
 | |
|         if(!strstr($descr, "No") && !strstr($usage, "No") && $descr != "" ) 
 | |
|         {
 | |
|           discover_processor($valid_processor, $device, $usage_oid, $index, "ironware", $descr, $precision, $usage, $entPhysicalIndex, NULL);
 | |
|         }
 | |
|       }
 | |
|     }
 | |
|   } 
 | |
|   ## End Cisco Processors
 | |
| 
 | |
|   unset ($processors_array);
 | |
| 
 | |
| ?>
 |