mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
  if (strstr($device['sysDescr'], "IBM Flex System Fabric")) {
 | 
						|
      $check_oids = snmp_get($device, ".1.3.6.1.4.1.20301.2.5.1.3.1.22.0", "-OsqnU", "");
 | 
						|
      if ($check_oids !== FALSE) {
 | 
						|
      	  $index = 0;
 | 
						|
          echo("IBM Flex System Fabric ");
 | 
						|
          $temps = array();
 | 
						|
          $temps['1.3.6.1.4.1.20301.2.5.1.3.1.22.0'] = "Temperature Sensor 1";
 | 
						|
          $temps['1.3.6.1.4.1.20301.2.5.1.3.1.23.0'] = "Temperature Sensor 2";
 | 
						|
          $temps['1.3.6.1.4.1.20301.2.5.1.3.1.26.0'] = "Temperature Sensor 3";
 | 
						|
          $temps['1.3.6.1.4.1.20301.2.5.1.3.1.27.0'] = "Temperature Sensor 4";
 | 
						|
          if (strstr($device['hardware'], "EN4093R 10Gb Scalable Switch")) {
 | 
						|
              $temps['1.3.6.1.4.1.20301.2.5.1.3.1.36.0'] = "Temperature Sensor 5";
 | 
						|
          }
 | 
						|
          
 | 
						|
          foreach ($temps as $obj => $descr) {
 | 
						|
              $oids = snmp_get($device, $obj, "-OsqnU", "");
 | 
						|
              list(,$current) = explode(' ',$oids);
 | 
						|
              $index = $obj;
 | 
						|
              $divisor = "1";
 | 
						|
              $multiplier = "1";
 | 
						|
              $type = "ibmnos";
 | 
						|
              discover_sensor($valid['sensor'], 'temperature', $device, $obj, $index, $type, $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current);
 | 
						|
          }
 | 
						|
      }
 | 
						|
  }
 |