From c22283e218ad3cd28960fe72de04cd5f2c9ffd34 Mon Sep 17 00:00:00 2001 From: Lorenzo Zafra Date: Wed, 12 Apr 2017 12:35:55 -0600 Subject: [PATCH] newdevice: Added signal sensor for opengear devices (#6401) --- .../discovery/sensors/signal/opengear.inc.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 includes/discovery/sensors/signal/opengear.inc.php diff --git a/includes/discovery/sensors/signal/opengear.inc.php b/includes/discovery/sensors/signal/opengear.inc.php new file mode 100644 index 0000000000..6bf294fb27 --- /dev/null +++ b/includes/discovery/sensors/signal/opengear.inc.php @@ -0,0 +1,50 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Lorenzo Zafra + * @author Lorenzo Zafra + */ + +// 3G Signal + +$threeG_signal = trim(snmp_get($device, 'ogCellModem3gRssi.1', '-Oqv', 'OG-STATUSv2-MIB'), '" '); +if (!empty($threeG_signal)) { + $divisor = 1; + $index = '11.1'; + $descr = 'Cellular 3G RSSI'; + $type = 'opengear'; + $oid = '.1.3.6.1.4.1.25049.17.17.1.11.1'; + $current_value = $threeG_signal / $divisor; + discover_sensor($valid['sensor'], 'signal', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current_value); +} + +// 4G Signal + +$fourG_signal = trim(snmp_get($device, 'ogCellModem4gRssi.1', '-Oqv', 'OG-STATUSv2-MIB'), '" '); +if (!empty($fourG_signal)) { + $divisor = 1; + $index = '12.1'; + $descr = 'Cellular 4G RSSI'; + $type = 'opengear'; + $oid = '.1.3.6.1.4.1.25049.17.17.1.12.1'; + $current_value = $fourG_signal / $divisor; + discover_sensor($valid['sensor'], 'signal', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current_value); +}