mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added more detection for IgniteNet FusionSwitch (#7384)
* newdevice: Added more detection for IgniteNet FusionSwitch * fixed current graphs descr * small updates * small updates recommended by murrant
This commit is contained in:
committed by
Tony Murray
parent
6701fad686
commit
e751206f74
@@ -6,7 +6,7 @@ require 'includes/graphs/common.inc.php';
|
|||||||
|
|
||||||
$rrd_options .= " COMMENT:' Min Last Max\\n'";
|
$rrd_options .= " COMMENT:' Min Last Max\\n'";
|
||||||
|
|
||||||
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 18), 0, 18);
|
$sensor['sensor_descr_fixed'] = rrdtool_escape($sensor['sensor_descr'], 21);
|
||||||
|
|
||||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".$sensor['sensor_descr_fixed']."'";
|
$rrd_options .= " LINE1.5:sensor#cc0000:'".$sensor['sensor_descr_fixed']."'";
|
||||||
|
115
includes/definitions/discovery/fusion.yaml
Normal file
115
includes/definitions/discovery/fusion.yaml
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
mib: ES4552BH2-MIB
|
||||||
|
modules:
|
||||||
|
sensors:
|
||||||
|
pre-cache:
|
||||||
|
data:
|
||||||
|
- oid:
|
||||||
|
- portTransceiverThresholdInfoTable
|
||||||
|
- portTable
|
||||||
|
voltage:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: portOpticalMonitoringInfoTable
|
||||||
|
value: portOpticalMonitoringInfoVcc
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.2.11.1.3.
|
||||||
|
descr: '{{ $portName }}'
|
||||||
|
index: 'portOpticalMonitoringInfoVcc.{{ $index }}'
|
||||||
|
low_warn_limit: portTransceiverThresholdInfoVccLowWarn
|
||||||
|
low_limit: portTransceiverThresholdInfoVccLowAlarm
|
||||||
|
warn_limit: portTransceiverThresholdInfoVccHighWarn
|
||||||
|
high_limit: portTransceiverThresholdInfoVccHighAlarm
|
||||||
|
current:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: portOpticalMonitoringInfoTable
|
||||||
|
value: portOpticalMonitoringInfoTxBiasCurrent
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.2.11.1.4.
|
||||||
|
descr: '{{ $portName }} - Tx'
|
||||||
|
index: 'portOpticalMonitoringInfoTxBiasCurrent.{{ $index }}'
|
||||||
|
low_warn_limit: portTransceiverThresholdInfoTxBiasCurrentLowWarn
|
||||||
|
low_limit: portTransceiverThresholdInfoTxBiasCurrentLowAlarm
|
||||||
|
warn_limit: portTransceiverThresholdInfoTxBiasCurrentHighWarn
|
||||||
|
high_limit: portTransceiverThresholdInfoTxBiasCurrentHighAlarm
|
||||||
|
divisor: 1000
|
||||||
|
dbm:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: portOpticalMonitoringInfoTable
|
||||||
|
value: portOpticalMonitoringInfoTxPower
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.2.11.1.5.
|
||||||
|
descr: '{{ $portName }} - Tx'
|
||||||
|
index: 'portOpticalMonitoringInfoTxPower.{{ $index }}'
|
||||||
|
low_warn_limit: portTransceiverThresholdInfoTxPowerLowWarn
|
||||||
|
low_limit: portTransceiverThresholdInfoTxPowerLowAlarm
|
||||||
|
warn_limit: portTransceiverThresholdInfoTxPowerHighWarn
|
||||||
|
high_limit: portTransceiverThresholdInfoTxPowerHighAlarm
|
||||||
|
-
|
||||||
|
oid: portOpticalMonitoringInfoTable
|
||||||
|
value: portOpticalMonitoringInfoRxPower
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.2.11.1.6.
|
||||||
|
descr: '{{ $portName }} - Rx'
|
||||||
|
index: 'portOpticalMonitoringInfoRxPower.{{ $index }}'
|
||||||
|
low_warn_limit: portTransceiverThresholdInfoRxPowerLowWarn
|
||||||
|
low_limit: portTransceiverThresholdInfoRxPowerLowAlarm
|
||||||
|
warn_limit: portTransceiverThresholdInfoRxPowerHighWarn
|
||||||
|
high_limit: portTransceiverThresholdInfoRxPowerHighAlarm
|
||||||
|
temperature:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: portOpticalMonitoringInfoTable
|
||||||
|
value: portOpticalMonitoringInfoTemperature
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.2.11.1.2.
|
||||||
|
descr: '{{ $portName }}'
|
||||||
|
index: 'portOpticalMonitoringInfoTemperature.{{ $index }}'
|
||||||
|
low_warn_limit: portTransceiverThresholdInfoTemperatureLowWarn
|
||||||
|
low_limit: portTransceiverThresholdInfoTemperatureLowAlarm
|
||||||
|
warn_limit: portTransceiverThresholdInfoTemperatureHighWarn
|
||||||
|
high_limit: portTransceiverThresholdInfoTemperatureHighAlarm
|
||||||
|
-
|
||||||
|
oid: switchThermalTempTable
|
||||||
|
value: switchThermalTempValue
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.1.11.1.3.
|
||||||
|
descr: 'Thermal {{ $index }}'
|
||||||
|
index: 'switchThermalTempValue.{{ $index }}'
|
||||||
|
fanspeed:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: switchFanTable
|
||||||
|
value: switchFanOperSpeed
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.1.9.1.6.
|
||||||
|
descr: 'Fan {{ $index }}'
|
||||||
|
index: 'switchFanOperSpeed.{{ $index }}'
|
||||||
|
state:
|
||||||
|
data:
|
||||||
|
-
|
||||||
|
oid: switchFanTable
|
||||||
|
value: switchFanStatus
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.1.9.1.3.
|
||||||
|
descr: 'Fan {{ $index }}'
|
||||||
|
index: 'switchFanStatus.{{ $index }}'
|
||||||
|
state_name: switchFanStatus
|
||||||
|
states:
|
||||||
|
- { value: 1, generic: 0, graph: 1, descr: ok }
|
||||||
|
- { value: 2, generic: 2, graph: 1, descr: failure }
|
||||||
|
-
|
||||||
|
oid: switchInfoTable
|
||||||
|
value: swPowerStatus
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.1.3.1.8.
|
||||||
|
descr: Power state
|
||||||
|
index: 'swPowerStatus.{{ $index }}'
|
||||||
|
state_name: swPowerStatus
|
||||||
|
states:
|
||||||
|
- { value: 1, generic: 1, graph: 1, descr: internalPower }
|
||||||
|
- { value: 2, generic: 0, graph: 1, descr: redundantPower }
|
||||||
|
- { value: 3, generic: 0, graph: 1, descr: internalAndRedundantPower }
|
||||||
|
-
|
||||||
|
oid: switchInfoTable
|
||||||
|
value: swRoleInSystem
|
||||||
|
num_oid: .1.3.6.1.4.1.259.6.10.120.1.1.3.1.9.
|
||||||
|
descr: Switch role
|
||||||
|
index: 'swRoleInSystem.{{ $index }}'
|
||||||
|
state_name: swRoleInSystem
|
||||||
|
states:
|
||||||
|
- { value: 1, generic: 0, graph: 1, descr: master }
|
||||||
|
- { value: 2, generic: 0, graph: 1, descr: backupMaster }
|
||||||
|
- { value: 3, generic: 0, graph: 1, descr: slave }
|
@@ -1088,8 +1088,17 @@ function discovery_process(&$valid, $device, $sensor_type, $pre_cache)
|
|||||||
foreach ($raw_data as $index => $snmp_data) {
|
foreach ($raw_data as $index => $snmp_data) {
|
||||||
// get the value for this sensor, check 'value' and 'oid', if state string, translate to a number
|
// get the value for this sensor, check 'value' and 'oid', if state string, translate to a number
|
||||||
$data_name = isset($data['value']) ? $data['value'] : $data['oid']; // fallback to oid if value is not set
|
$data_name = isset($data['value']) ? $data['value'] : $data['oid']; // fallback to oid if value is not set
|
||||||
if (is_numeric($snmp_data[$data_name])) {
|
|
||||||
$value = $snmp_data[$data_name];
|
$tmp_value = $snmp_data[$data_name];
|
||||||
|
if (!is_numeric($tmp_value)) {
|
||||||
|
preg_match('/-?\d*\.?\d+/', $tmp_value, $temp_response);
|
||||||
|
if (!empty($temp_response[0])) {
|
||||||
|
$tmp_value = $temp_response[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_numeric($tmp_value)) {
|
||||||
|
$value = $tmp_value;
|
||||||
} elseif ($sensor_type === 'state') {
|
} elseif ($sensor_type === 'state') {
|
||||||
// translate string states to values (poller does this as well)
|
// translate string states to values (poller does this as well)
|
||||||
$states = array_column($data['states'], 'value', 'descr');
|
$states = array_column($data['states'], 'value', 'descr');
|
||||||
|
31
includes/polling/os/fusion.inc.php
Normal file
31
includes/polling/os/fusion.inc.php
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* fusion.inc.php
|
||||||
|
*
|
||||||
|
* LibreNMS OS poller module for IgniteNet FusionSwitch
|
||||||
|
*
|
||||||
|
* 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 <gh+n@laf.io>
|
||||||
|
*/
|
||||||
|
|
||||||
|
$fusion_tmp = snmp_get_multi_oid($device, 'swSerialNumber.1 swOpCodeVer.1 swModelNumber.1', '-OUQs', 'ES4552BH2-MIB');
|
||||||
|
$serial = $fusion_tmp['swSerialNumber.1'];
|
||||||
|
$hardware = $fusion_tmp['swModelNumber.1'];
|
||||||
|
$version = $fusion_tmp['swOpCodeVer.1'];
|
||||||
|
|
||||||
|
unset($fusion_tmp);
|
20587
mibs/ignitenet/ES4552BH2-MIB
Normal file
20587
mibs/ignitenet/ES4552BH2-MIB
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user