(is_numeric($limits['limit_high']) ? $limits['limit_high'] : NULL), 'limit_low' => (is_numeric($limits['limit_low']) ? $limits['limit_low'] : NULL)]; discover_sensor_ng($device, 'temperature', $mib, $oid_name, $oid, $index, $descr, $scale, $value, $options); } // Humidity/Volts if (is_numeric($oids[2]['wtWebGraphThermoHygroBinaryTempValue'])) { // Binary coded options for sensor 2: // Octet 1: unused // Octet 2: unused // Octet 3: unused // Octet 4: // Bit 0 : W&T Sensor rel. humidity (default) // Bit 1 : Skalar 0-2.5V // Bit 2 : Disconnect // Bit 3-7: unused" [, , , $octet] = explode(' ', $oids[2]['wtWebGraphThermoHygroPortSensorSelect']); $index = 2; $scale = 0.1; $descr = $oids[2]['wtWebGraphThermoHygroPortName']; $oid = '.1.3.6.1.4.1.5040.1.2.42.1.4.1.1.2'; $oid_name = 'wtWebGraphThermoHygroBinaryTempValue'; $value = $oids[2]['wtWebGraphThermoHygroBinaryTempValue']; if ($octet == "01") { // Humidity $limits = snmp_get_multi_oid($device, 'wtWebGraphThermoHygroAlarmRHMin.1 wtWebGraphThermoHygroAlarmRHMax.1', [], $mib); $limits['limit_high'] = trim($limits[1]['wtWebGraphThermoHygroAlarmRHMax'], ' "'); $limits['limit_low'] = trim($limits[1]['wtWebGraphThermoHygroAlarmRHMin'], ' "'); $options = ['limit_high' => (is_numeric($limits['limit_high']) ? $limits['limit_high'] : NULL), 'limit_low' => (is_numeric($limits['limit_low']) ? $limits['limit_low'] : NULL)]; discover_sensor_ng($device, 'humidity', $mib, $oid_name, $oid, $index, $descr, $scale, $value, $options); } elseif ($octet == "02") { // Voltage? Not tested discover_sensor_ng($device, 'voltage', $mib, $oid_name, $oid, $index, $descr, $scale, $value, $options); } } } unset($oids, $oid, $descr, $options, $limits, $value); // EOF