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@3117 61d68cd4-352d-0410-923a-c4978735b2b8
		
			
				
	
	
		
			41 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
if ($device['os'] == "pcoweb")
 | 
						|
{
 | 
						|
  echo(" pCOWeb ");
 | 
						|
 | 
						|
  $humidities = array(
 | 
						|
    array("mib" => "CAREL-ug40cdz-MIB::roomRH.0",     "descr" => "Room Relative Humidity",      "oid" => ".1.3.6.1.4.1.9839.2.1.2.6.0",  "precision" => "10"),
 | 
						|
    array("mib" => "CAREL-ug40cdz-MIB::dehumPband.0", "descr" => "Dehumidification Prop. Band", "oid" => ".1.3.6.1.4.1.9839.2.1.3.12.0", "precision" => "1"),
 | 
						|
    array("mib" => "CAREL-ug40cdz-MIB::humidPband.0", "descr" => "Humidification Prop. Band",   "oid" => ".1.3.6.1.4.1.9839.2.1.3.13.0", "precision" => "1"),
 | 
						|
    array("mib" => "CAREL-ug40cdz-MIB::dehumSetp.0",  "descr" => "Dehumidification Set Point",  "oid" => ".1.3.6.1.4.1.9839.2.1.3.16.0", "precision" => "1"),
 | 
						|
    array("mib" => "CAREL-ug40cdz-MIB::humidSetp.0",  "descr" => "Humidification Set Point",    "oid" => ".1.3.6.1.4.1.9839.2.1.3.17.0", "precision" => "1"),
 | 
						|
  );
 | 
						|
 | 
						|
  foreach ($humidities as $humidity)
 | 
						|
  {
 | 
						|
    $current = snmp_get($device, $humidity['mib'], "-OqvU") / $humidity['precision'];
 | 
						|
 | 
						|
    $high_limit = NULL;
 | 
						|
    $low_limit = NULL;
 | 
						|
 | 
						|
    if (is_numeric($current) && $current != 0)
 | 
						|
    {
 | 
						|
      $index = implode(".",array_slice(explode(".",$humidity['oid']),-5));
 | 
						|
      discover_sensor($valid['sensor'], 'humidity', $device, $humidity['oid'], $index, 'pcoweb', $humidity['descr'], $humidity['precision'], '1', $low_limit, NULL, NULL, $high_limit, $current);
 | 
						|
    }
 | 
						|
  }
 | 
						|
 | 
						|
/*
 | 
						|
FIXME
 | 
						|
 | 
						|
hhAlarmThrsh.0 = INTEGER: 80 rH%
 | 
						|
lhAlarmThrsh.0 = INTEGER: 30 rH%
 | 
						|
smDehumSetp.0 = INTEGER: 75 rH%
 | 
						|
smHumidSetp.0 = INTEGER: 35 rH%
 | 
						|
*/
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
?>
 |