| 
									
										
										
										
											2010-02-25 00:56:13 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | if ($device['os'] == 'ironware' || $device['os_type'] == 'ironware') { | 
					
						
							| 
									
										
										
										
											2016-04-01 16:29:58 -05:00
										 |  |  |     $is_netiron = snmp_get($device, 'sysObjectID.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (strpos($is_netiron, 'NI') === false && strpos($is_netiron, 'MLX') === false && strpos($is_netiron, 'Cer') === false) { | 
					
						
							|  |  |  |         echo 'Ironware Dynamic: '; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         $percent = snmp_get($device, 'snAgGblDynMemUtil.0', '-OvQ', 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if (is_numeric($percent)) { | 
					
						
							|  |  |  |             discover_mempool($valid_mempool, $device, 0, 'ironware-dyn', 'Dynamic Memory', '1', null, null); | 
					
						
							|  |  |  |         } //end_if
 | 
					
						
							|  |  |  |     } //end_if
 | 
					
						
							|  |  |  |     else { | 
					
						
							|  |  |  |         echo 'NetIron: '; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         d_echo('caching'); | 
					
						
							| 
									
										
										
										
											2016-09-28 08:19:28 -05:00
										 |  |  |         $ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMainBrdDescription', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							|  |  |  |         $ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryUtil100thPercent', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							|  |  |  |         $ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryAvailable', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							|  |  |  |         $ni_mempools_array = snmpwalk_cache_multi_oid($device, 'snAgentBrdMemoryTotal', $ni_mempools_array, 'FOUNDRY-SN-AGENT-MIB'); | 
					
						
							| 
									
										
										
										
											2016-04-01 16:29:58 -05:00
										 |  |  |         d_echo($ni_mempool_array); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-28 12:32:58 -05:00
										 |  |  |         if (is_array($ni_mempools_array)) { | 
					
						
							|  |  |  |             foreach ($ni_mempools_array as $index => $entry) { | 
					
						
							|  |  |  |                 d_echo($index.' '.$entry['snAgentBrdMainBrdDescription'].' -> '.$entry['snAgentBrdMemoryUtil100thPercent']."\n"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $usage_oid = '.1.3.6.1.4.1.1991.1.1.2.2.1.1.28.'.$index; | 
					
						
							|  |  |  |                 $descr     = $entry['snAgentBrdMainBrdDescription']; | 
					
						
							|  |  |  |                 $usage     = ($entry['snAgentBrdMemoryUtil100thPercent'] / 100); | 
					
						
							|  |  |  |                 if (!strstr($descr, 'No') && !strstr($usage, 'No') && $descr != '') { | 
					
						
							|  |  |  |                     discover_mempool($valid_mempool, $device, $index, 'ironware-dyn', $descr, '1', null, null); | 
					
						
							|  |  |  |                 } //end_if
 | 
					
						
							|  |  |  |             } //end_foreach
 | 
					
						
							| 
									
										
										
										
											2016-04-01 16:29:58 -05:00
										 |  |  |         } //end_if
 | 
					
						
							| 
									
										
										
										
											2016-08-28 12:32:58 -05:00
										 |  |  |     } //end_else
 | 
					
						
							| 
									
										
										
										
											2016-04-01 16:29:58 -05:00
										 |  |  | } //end_if
 |