mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Dantel WebMon Device Support (#9767)
* Dantel WebMon Support Webmon tep discovery changes Fix Code Climate Issues * WebMon - Move MIB to folder and create json reference * Minor changes to Webmon polling
This commit is contained in:
12
includes/definitions/webmon.yaml
Normal file
12
includes/definitions/webmon.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
os: webmon
|
||||
text: 'Webmon Edge'
|
||||
type: environment
|
||||
icon: dantel
|
||||
mib_dir:
|
||||
- dantel
|
||||
over:
|
||||
- { graph: device_temperature, text: Temperature }
|
||||
- { graph: device_humidity, text: Humidity }
|
||||
discovery:
|
||||
- sysObjectID:
|
||||
- .1.3.6.1.4.1.994.3.4
|
31
includes/discovery/sensors/humidity/webmon.inc.php
Normal file
31
includes/discovery/sensors/humidity/webmon.inc.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS Dantel Webmon humidity sensor
|
||||
*
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2019 Mike Williams
|
||||
* @author Mike Williams <mike@mgww.net>
|
||||
*/
|
||||
|
||||
$env = snmpwalk_group($device, 'pSlot1Table', 'WEBMON-EDGE-MATRIX-MIB');
|
||||
|
||||
if (!empty($env)) {
|
||||
$oid = '.1.3.6.1.4.1.994.3.4.7.18.1.66.1.0';
|
||||
$index = '1';
|
||||
|
||||
$descr = $env[1]['pSlot1Description'][0];
|
||||
$value = $env[1]['pSlot1LiveRaw'][0];
|
||||
$lowlimit = $env[1]['pSlot1Thresh4'][0];
|
||||
$low_warn_limit = $env[1]['pSlot1Thresh3'][0];
|
||||
$warnlimit = $env[1]['pSlot1Thresh2'][0];
|
||||
$high_limit = $env[1]['pSlot1Thresh1'][0];
|
||||
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, 'webmon', $descr, '1', '1', $lowlimit, $low_warn_limit, $warnlimit, $high_limit, $value, 'snmp', null, null, null, null);
|
||||
}
|
41
includes/discovery/sensors/temperature/webmon.inc.php
Normal file
41
includes/discovery/sensors/temperature/webmon.inc.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS Dantel Webmon temperature sensor
|
||||
*
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2019 Mike Williams
|
||||
* @author Mike Williams <mike@mgww.net>
|
||||
*/
|
||||
|
||||
$env = snmpwalk_group($device, 'pSlot1Table', 'WEBMON-EDGE-MATRIX-MIB');
|
||||
|
||||
if (!empty($env)) {
|
||||
$oid = '.1.3.6.1.4.1.994.3.4.7.18.1.66.2.0';
|
||||
$index = '2';
|
||||
|
||||
$descr = $env[2]['pSlot1Description'][0];
|
||||
$value = $env[2]['pSlot1LiveRaw'][0];
|
||||
$lowlimit = $env[2]['pSlot1Thresh4'][0];
|
||||
$low_warn_limit = $env[2]['pSlot1Thresh3'][0];
|
||||
$warnlimit = $env[2]['pSlot1Thresh2'][0];
|
||||
$high_limit = $env[2]['pSlot1Thresh1'][0];
|
||||
$func = null;
|
||||
if ($env[2]['pSlot1Units'][0] == 'Fahrenheit') {
|
||||
$func = 'fahrenheit_to_celsius';
|
||||
$value = fahrenheit_to_celsius($value);
|
||||
$lowlimit = fahrenheit_to_celsius($lowlimit);
|
||||
$low_warn_limit = fahrenheit_to_celsius($low_warn_limit);
|
||||
$warnlimit = fahrenheit_to_celsius($warnlimit);
|
||||
$high_limit = fahrenheit_to_celsius($high_limit);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'webmon', $descr, '1', '1', $lowlimit, $low_warn_limit, $warnlimit, $high_limit, $value, 'snmp', null, null, $func, null);
|
||||
}
|
17
includes/polling/os/webmon.inc.php
Normal file
17
includes/polling/os/webmon.inc.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS Dantel Webmon poller module
|
||||
*
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2019 Mike Williams
|
||||
* @author Mike Williams <mike@mgww.net>
|
||||
*/
|
||||
|
||||
$version = snmp_get($device, '.1.3.6.1.4.1.994.3.4.7.1.82.0.0', '-OQv', 'WEBMON-EDGE-MATRIX-MIB');
|
Reference in New Issue
Block a user