diff --git a/includes/discovery/sensors-openbsd.inc.php b/includes/discovery/sensors-openbsd.inc.php new file mode 100644 index 000000000..c68fc238c --- /dev/null +++ b/includes/discovery/sensors-openbsd.inc.php @@ -0,0 +1,67 @@ + $entry) { + // echo("[" . $entry['sensorType'] . "|" . $entry['sensorValue']. "|" . $index . "]"); + if ($entitysensor[$entry['sensorType']] && is_numeric($entry['sensorValue']) && is_numeric($index)) { + $entPhysicalIndex = $index; + $oid = '.1.3.6.1.4.1.30155.2.1.2.1.5.'.$index; + $current = $entry['sensorValue']; + $descr = $entity_array[$index]['sensorDevice'].' '.$entity_array[$index]['sensorDescr']; + $bogus = false; + + $type = $entitysensor[$entry['sensorType']]; + + if ($type == 'voltage') { + $descr = preg_replace('/ (voltages|voltage)/i', '', $descr); + } + + if ($type == 'temperature') { + if ($current < -40 || $current > 200) { + $bogus = true; + } + $descr = preg_replace('/ (temperature|temp)/i', '', $descr); + } + + if ($current == '-127') { + $bogus = true; + } + + // echo($descr . "|" . $index . "|" .$current . "|" . $bogus . "\n"); + if (! $bogus) { + discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'openbsd-sensor', $descr, '1', '1', null, null, null, null, $current); + } + }//end if + }//end foreach +}//end if + +echo "\n"; diff --git a/includes/discovery/sensors.inc.php b/includes/discovery/sensors.inc.php index 6f4d17b35..257777049 100644 --- a/includes/discovery/sensors.inc.php +++ b/includes/discovery/sensors.inc.php @@ -12,6 +12,10 @@ if ($device['os'] == 'netscaler') { include 'includes/discovery/sensors-netscaler.inc.php'; } +if ($device['os'] == 'openbsd') { + include 'includes/discovery/sensors-openbsd.inc.php'; +} + require 'includes/discovery/temperatures.inc.php'; require 'includes/discovery/humidity.inc.php'; require 'includes/discovery/voltages.inc.php';