forked from librenms/librenms
/
sensors.inc.php
87 lines (74 loc) · 1.98 KB
/
sensors.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
use LibreNMS\Config;
use LibreNMS\OS;
$valid['sensor'] = [];
/** @var OS $os */
$pre_cache = $os->preCache();
if ($device['os'] == 'rittal-cmc-iii-pu') {
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 (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',
'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, $device, $valid, $pre_cache);
unset(
$pre_cache,
$run_sensors,
$entitysensor
);