mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added detection for Atal Ethernetprobe (#6778)
* newdevice: Added detection for Atal Ethernetprobe * updated to ethernetprobe2 * added temp and humidity sensors
This commit is contained in:
BIN
html/images/logos/atal.png
Normal file
BIN
html/images/logos/atal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
html/images/os/atal.png
Normal file
BIN
html/images/os/atal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 893 B |
11
includes/definitions/ethernetprobe2.yaml
Normal file
11
includes/definitions/ethernetprobe2.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
os: ethernetprobe2
|
||||||
|
text: Atal Ethernetprobe2
|
||||||
|
type: environment
|
||||||
|
icon: atal
|
||||||
|
mib_dir:
|
||||||
|
- atal
|
||||||
|
over:
|
||||||
|
- { graph: device_bits, text: 'Device Traffic' }
|
||||||
|
discovery:
|
||||||
|
- sysDescr:
|
||||||
|
- EthernetProbe2
|
||||||
39
includes/discovery/sensors/humidity/ethernetprobe2.inc.php
Normal file
39
includes/discovery/sensors/humidity/ethernetprobe2.inc.php
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* etherprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS temperature sensor discover module for Atal EtherProbe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2017 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
foreach ($pre_cache['ethernetprobe2_sensorProbeHumidityTable'] as $index => $data) {
|
||||||
|
if ($data['sensorProbeHumidityOnline'] === 'online') {
|
||||||
|
if (is_numeric($data['sensorProbeHumidityRaw'])) {
|
||||||
|
$oid = '.1.3.6.1.4.1.3854.1.2.2.1.17.1.13.' . $index;
|
||||||
|
$descr = $data['sensorProbeHumidityDescription'];
|
||||||
|
$value = $data['sensorProbeHumidityRaw'];
|
||||||
|
$low_limit = $data['sensorProbeHumidityLowCritical'];
|
||||||
|
$low_warn_limit = $data['sensorProbeHumidityLowWarning'];
|
||||||
|
$warn_limit = $data['sensorProbeHumidityHighWarning'];
|
||||||
|
$high_limit = $data['sensorProbeHumidityHighCritical'];
|
||||||
|
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, 'ethernetprobe2', $descr, 1, '1', $low_limit, $low_warn_limit, $warn_limit, $high_limit, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
30
includes/discovery/sensors/pre-cache/ethernetprobe2.inc.php
Normal file
30
includes/discovery/sensors/pre-cache/ethernetprobe2.inc.php
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* etherprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS pre-cache discover module for Atal EtherProbe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2017 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
echo 'sensorProbeTempTable ';
|
||||||
|
$pre_cache['ethernetprobe2_sensorProbeTempTable'] = snmpwalk_cache_oid($device, 'sensorProbeTempTable', array(), 'SPAGENT-MIB');
|
||||||
|
|
||||||
|
echo 'sensorProbeHumidityTable ';
|
||||||
|
$pre_cache['ethernetprobe2_sensorProbeHumidityTable'] = snmpwalk_cache_oid($device, 'sensorProbeHumidityTable', array(), 'SPAGENT-MIB');
|
||||||
53
includes/discovery/sensors/state/ethernetprobe2.inc.php
Normal file
53
includes/discovery/sensors/state/ethernetprobe2.inc.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* etherprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS state discover module for Atal EtherProbe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2017 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
$status_value = snmp_get($device, 'spStatus.0', '-Oqve', 'SPAGENT-MIB');
|
||||||
|
|
||||||
|
if (is_numeric($status_value)) {
|
||||||
|
$state = 'spStatus';
|
||||||
|
$state_index_id = create_state_index($state);
|
||||||
|
if ($state_index_id) {
|
||||||
|
$states = array(
|
||||||
|
array($state_index_id, 'noStatus', 1, 1, 1),
|
||||||
|
array($state_index_id, 'normal', 1, 2, 0),
|
||||||
|
array($state_index_id, 'warning', 1, 3, 1),
|
||||||
|
array($state_index_id, 'critical', 1, 4, 2),
|
||||||
|
array($state_index_id, 'sensorError', 1, 5, 2),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($states as $value) {
|
||||||
|
$insert = array(
|
||||||
|
'state_index_id' => $value[0],
|
||||||
|
'state_descr' => $value[1],
|
||||||
|
'state_draw_graph' => $value[2],
|
||||||
|
'state_value' => $value[3],
|
||||||
|
'state_generic_value' => $value[4]
|
||||||
|
);
|
||||||
|
dbInsert($insert, 'state_translations');
|
||||||
|
}
|
||||||
|
discover_sensor($valid['sensor'], 'state', $device, '.1.3.6.1.4.1.3854.1.1.2.0', 'ethernetprobe2', $state, 'Sensor state', '1', '1', null, null, null, null, $status_value);
|
||||||
|
create_sensor_to_state_index($device, $state, 'ethernetprobe2');
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* etherprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS temperature sensor discover module for Atal EtherProbe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2017 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
foreach ($pre_cache['ethernetprobe2_sensorProbeTempTable'] as $index => $data) {
|
||||||
|
if ($data['sensorProbeTempOnline'] === 'online') {
|
||||||
|
if (is_numeric($data['sensorProbeTempDegreeRaw'])) {
|
||||||
|
$oid = '.1.3.6.1.4.1.3854.1.2.2.1.16.1.14.' . $index;
|
||||||
|
$descr = $data['sensorProbeTempDescription'];
|
||||||
|
$divisor = 10;
|
||||||
|
$value = (fahrenheit_to_celsius($data['sensorProbeTempDegreeType'], $data['sensorProbeTempDegreeRaw']) / $divisor);
|
||||||
|
$low_limit = $data['sensorProbeTempLowCritical'];
|
||||||
|
$low_warn_limit = $data['sensorProbeTempLowWarning'];
|
||||||
|
$warn_limit = $data['sensorProbeTempHighWarning'];
|
||||||
|
$high_limit = $data['sensorProbeTempHighCritical'];
|
||||||
|
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'ethernetprobe2', $descr, $divisor, '1', $low_limit, $low_warn_limit, $warn_limit, $high_limit, $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
includes/polling/os/ethernetprobe2.inc.php
Normal file
26
includes/polling/os/ethernetprobe2.inc.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* etherprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS os polling module for Atal Etherprobe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2017 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
list(,$hardware,) = explode(' ', $poll_device['sysDescr']);
|
||||||
28
includes/polling/sensors/temperature/ethernetprobe2.inc.php
Normal file
28
includes/polling/sensors/temperature/ethernetprobe2.inc.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ethernetprobe2.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS sensors temp poller module for Atal EthernetProbe2
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* @package LibreNMS
|
||||||
|
* @link http://librenms.org
|
||||||
|
* @copyright 2016 Neil Lathwood
|
||||||
|
* @author Neil Lathwood <neil@lathwood.co.uk>
|
||||||
|
*/
|
||||||
|
|
||||||
|
$temp_type = snmp_get($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.12.' . $sensor['sensor_index'], '-Oqv', 'SPAGENT-MIB');
|
||||||
|
$sensor_value = fahrenheit_to_celsius($temp_type, $sensor_value);
|
||||||
|
unset($temp_type);
|
||||||
14058
mibs/atal/SPAGENT-MIB
Executable file
14058
mibs/atal/SPAGENT-MIB
Executable file
File diff suppressed because it is too large
Load Diff
2
tests/snmpsim/ethernetprobe2.snmprec
Normal file
2
tests/snmpsim/ethernetprobe2.snmprec
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1.3.6.1.2.1.1.1.0|4|EthernetProbe2 SP2403 071009
|
||||||
|
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.3854.1
|
||||||
Reference in New Issue
Block a user