Files
librenms-librenms/includes/discovery/sensors.inc.php
Denny Friebe f23c5c0e7b Raspberry Pi: Add SNMP extend to monitor IO pins or sensor modules connected to the GPIO header (#12749)
* Raspberry Pi: Add SNMP extend to monitor IO pins or sensor modules connected to the GPIO header

* Raspberry Pi: Add new test data

* Raspberry Pi: Make styleci happy

* Raspberry Pi: Fix some more style issues

* Raspberry Pi: Use d_echo for array debug

* Raspberry Pi: Prevent processing if the extension is not present

* Raspberry Pi: Make styleci happy

* Raspberry Pi: Update test data

* Raspberry Pi: Remove debugging
2021-11-04 21:38:15 -05:00

93 lines
2.1 KiB
PHP

<?php
use LibreNMS\Config;
use LibreNMS\OS;
$valid['sensor'] = [];
/** @var OS $os */
$pre_cache = $os->preCache();
if ($device['os'] == 'rittal-cmc-iii-pu' || $device['os'] == 'rittal-lcp') {
include 'includes/discovery/sensors/rittal-cmc-iii-sensors.inc.php';
} else {
// Run custom sensors
require 'includes/discovery/sensors/cisco-entity-sensor.inc.php';
require 'includes/discovery/sensors/entity-sensor.inc.php';
require 'includes/discovery/sensors/ipmi.inc.php';
}
if ($device['os'] == 'netscaler') {
include 'includes/discovery/sensors/netscaler.inc.php';
}
if ($device['os'] == 'openbsd') {
include 'includes/discovery/sensors/openbsd.inc.php';
}
if ($device['os'] == 'linux') {
include 'includes/discovery/sensors/rpigpiomonitor.inc.php';
}
if (strstr($device['hardware'], 'Dell')) {
include 'includes/discovery/sensors/fanspeed/dell.inc.php';
include 'includes/discovery/sensors/power/dell.inc.php';
include 'includes/discovery/sensors/voltage/dell.inc.php';
include 'includes/discovery/sensors/state/dell.inc.php';
include 'includes/discovery/sensors/temperature/dell.inc.php';
}
if (strstr($device['hardware'], 'ProLiant')) {
include 'includes/discovery/sensors/state/hp.inc.php';
}
if ($device['os'] == 'gw-eydfa') {
include 'includes/discovery/sensors/gw-eydfa.inc.php';
}
if ($device['os_group'] == 'printer') {
include 'includes/discovery/sensors/state/printer.inc.php';
}
$run_sensors = [
'airflow',
'current',
'charge',
'dbm',
'fanspeed',
'frequency',
'humidity',
'load',
'loss',
'power',
'power_consumed',
'power_factor',
'runtime',
'signal',
'state',
'count',
'temperature',
'tv_signal',
'voltage',
'snr',
'pressure',
'cooling',
'delay',
'quality_factor',
'chromatic_dispersion',
'ber',
'eer',
'waterflow',
'percent',
];
// filter submodules
$run_sensors = array_intersect($run_sensors, Config::get('discovery_submodules.sensors', $run_sensors));
sensors($run_sensors, $os, $valid, $pre_cache);
unset(
$pre_cache,
$run_sensors,
$entitysensor
);