Added support for Liebert PDUs (#10062)

* Added support for Liebert PDUs
This commit is contained in:
Spencer Butler
2019-04-07 14:19:08 -05:00
committed by TheGreatDoc
parent edf81cca7e
commit 47e0ee1d04
17 changed files with 3357 additions and 170 deletions

View File

@@ -0,0 +1,115 @@
mib: LIEBERT-GP-AGENT-MIB:LIEBERT-GP-PDU-MIB
modules:
sensors:
temperature:
data:
-
oid: lgpPduAuxMeasTable
value: lgpPduAuxMeasTempDegC
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.70.{{ $index }}'
descr: 'Temp for {{ $lgpPduAuxMeasUsrLabel }}'
index: 'lgpPduAuxMeasTempDegC.{{ $index }}'
divisor: 10
low_limit: lgpPduAuxMeasTempThrshldUndrAlmDegC
low_warn_limit: lgpPduAuxMeasTempThrshldUndrWarnDegC
warn_limit: lgpPduAuxMeasTempThrshldOvrWarnDegC
high_limit: lgpPduAuxMeasTempThrshldOvrAlmDegC
humidity:
data:
-
oid: lgpPduAuxMeasTable
value: lgpPduAuxMeasHum
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.60.15.1.95.{{ $index }}'
descr: 'Humidity for {{ $lgpPduAuxMeasUsrLabel }}'
index: 'lgpPduAuxMeasHum.{{ $index }}'
divisor: 10
low_limit: lgpPduAuxMeasHumThrshldUndrAlm
low_warn_limit: lgpPduAuxMeasHumThrshldUndrWarn
warn_limit: lgpPduAuxMeasHumThrshldOvrWarn
high_limit: lgpPduAuxMeasHumThrshldOvrAlm
voltage:
data:
-
oid: lgpPduPsLineTable
value: lgpPduPsLineEntryEpLNTenths
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.30.40.1.19.{{ $index }}'
descr: 'AC RMS {{ $lgpPduPsLineEntryLine }}'
index: 'lgpPduPsLineEntryEpLNTenths.{{ $index }}'
divisor: 10
power:
data:
-
oid: lgpPduPsTable
value: lgpPduPsEntryPwrTotal
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.65.{{ $index }}'
descr: 'Total for {{ $lgpPduPsEntryModel }}'
index: 'lgpPduPsEntryPwrTotal.{{ $index }}'
-
oid: lgpPduPsTable
value: lgpPduPsEntryApTotal
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.90.{{ $index }}'
descr: 'Apparent Power for {{ $lgpPduPsEntryModel }}'
index: 'lgpPduPsEntryApTotal.{{ $index }}'
current:
data:
-
oid: lgpPduRbTable
value: lgpPduRbEntryEcAvailBeforeAlarmHundredths
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.150.{{ $index }}'
descr: 'Before Alarm {{ $lgpPduRbEntryUsrLabel }}'
index: 'lgpPduRbEntryEcAvailBeforeAlarmHundredths.{{ $index }}'
divisor: 100
group: Available
count:
data:
-
oid: lgpPduRbTable
value: lgpPduRbEntryEcUsedBeforeAlarm
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.160.{{ $index }}'
descr: 'Utilization Percent {{ $lgpPduRbEntryUsrLabel }}'
index: 'lgpPduRbEntryEcAvailBeforeAlarmHundredths.{{ $index }}'
divisor: 10
state:
data:
-
oid: lgpAgentTelnetEnabled
num_oid: '.1.3.6.1.4.1.476.1.42.2.5.2.{{ $index }}'
descr: Telnet Enabled
index: 'lgpAgentTelnetEnabled.{{ $index }}'
state_name: lgpAgentTelnetEnabled
states:
- { value: 1, graph: 0, descr: yes, generic: 0 }
- { value: 2, graph: 0, descr: no, generic: 2 }
-
oid: lgpAgentVelocityServerEnabled
num_oid: '.1.3.6.1.4.1.476.1.42.2.5.3.{{ $index }}'
descr: Velocity Server Enabled
index: 'lgpAgentVelocityServerEnabled.{{ $index }}'
state_name: lgpAgentVelocityServerEnabled
states:
- { value: 1, graph: 0, descr: yes, generic: 0 }
- { value: 2, graph: 0, descr: no, generic: 2 }
-
oid: lgpAgentWebServerMode
num_oid: '.1.3.6.1.4.1.476.1.42.2.5.4.{{ $index }}'
descr: Webserver Mode
index: 'lgpAgentWebServerMode.{{ $index }}'
state_name: lgpAgentWebServerMode
states:
- { value: 0, graph: 0, descr: disabled, generic: 2 }
- { value: 1, graph: 0, descr: http, generic: 1 }
- { value: 2, graph: 0, descr: https, generic: 0 }
-
oid: lgpPduEntrySysStatus
num_oid: '.1.3.6.1.4.1.476.1.42.3.8.20.1.25.{{ $index }}'
descr: System Status
index: 'lgpPduGrpSysStatus.{{ $index }}'
state_name: lgpPduEntrySysStatus
states:
- { value: 1, graph: 0, descr: normalOperation, generic: 0 }
- { value: 2, graph: 0, descr: startUp, generic: 1 }
- { value: 4, graph: 0, descr: unknownNoSupport, generic: 3 }
- { value: 8, graph: 0, descr: normalWithWarning, generic: 1 }
- { value: 16, graph: 0, descr: normalWithAlarm, generic: 2 }
- { value: 32, graph: 0, descr: abnormalOperation, generic: 2 }
- { value: 64, graph: 0, descr: unknownCommFailure, generic: 2 }

View File

@@ -2,6 +2,8 @@ os: liebert
text: Liebert
type: power
icon: vertiv
mib_dir:
- liebert
rfc1628_compat: true
discovery:
- sysObjectID:

View File

@@ -0,0 +1,164 @@
<?php
/**
* liebert.inc.php
*
* LibreNMS sensors (current) discovery module for Liebert PDUs
*
* 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 2019 Spencer Butler
* @author Spencer Butler <github@crooked.app>
*/
$entPhysicalIndex = null;
$entPhysicalIndex_measured = null;
$user_func = null;
$group = null;
$class = 'current';
$poller_type = 'snmp';
$psline_data = snmpwalk_cache_oid($device, 'lgpPduPsLineTable', [], 'LIEBERT-GP-PDU-MIB', 'liebert');
$ec_input_rated = snmp_getnext($device, 'lgpPduPsEntryEcInputRated', '-OUqsev', 'LIEBERT-GP-PDU-MIB', 'liebert');
foreach (array_keys($psline_data) as $index) {
$low_limit_p = $psline_data[$index]['lgpPduPsLineEntryEcThrshldUndrAlarm'] / 100;
$high_warn_limit_p = $psline_data[$index]['lgpPduPsLineEntryEcThrshldOvrWarn'] / 100;
$high_limit_p = $psline_data[$index]['lgpPduPsLineEntryEcThrshldOvrAlarm'] / 100;
$oid = '.1.3.6.1.4.1.476.1.42.3.8.30.40.1.22.'.$index;
$type = 'liebert';
$descr = 'Total Input Line ' . $psline_data[$index]['lgpPduPsLineEntryId'];
$divisor = 100;
$multiplier = 1;
$low_limit = $ec_input_rated * $low_limit_p;
$low_warn_limit = null;
$high_warn_limit = $ec_input_rated * $high_warn_limit_p;
$high_limit = $ec_input_rated * $high_limit_p;
$current = $psline_data[$index]['lgpPduPsLineEntryEcHundredths'];
discover_sensor(
$valid['sensor'],
$class,
$device,
$oid,
$index.'lgpPduPsLineEntryEcHundredths',
$type,
$descr,
$divisor,
$multiplier,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$current,
$poller_type,
$entPhysicalIndex,
$entPhysicalIndex_measured,
$user_func,
$group
);
}
unset($psline_data);
$ps_data = snmpwalk_cache_oid($device, 'lgpPduPsTable', [], 'LIEBERT-GP-PDU-MIB', 'liebert', '-OQUse');
foreach (array_keys($ps_data) as $index) {
$high_warn_limit_p = $ps_data[$index]['lgpPduPsEntryEcNeutralThrshldOvrWarn'] / 100;
$high_limit_p = $ps_data[$index]['lgpPduPsEntryEcNeutralThrshldOvrAlarm'] / 100;
$oid = '.1.3.6.1.4.1.476.1.42.3.8.30.20.1.70.'.$index;
$type = 'liebert';
$descr = 'Neutral ' . $ps_data[$index]['lgpPduPsLineEntryId'];
$divisor = 10;
$multiplier = 1;
$low_limit = null;
$low_warn_limit = null;
$high_warn_limit = $ec_input_rated * $high_warn_limit_p;
$high_limit = $ec_input_rated * $high_limit_p;
$current = $ps_data[$index]['lgpPduPsEntryEcNeutral'];
discover_sensor(
$valid['sensor'],
$class,
$device,
$oid,
$index.'lgpPduPsEntryEcNeutral',
$type,
$descr,
$divisor,
$multiplier,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$current,
$poller_type,
$entPhysicalIndex,
$entPhysicalIndex_measured,
$user_func,
$group
);
}
unset($ps_data);
$rb_data = snmpwalk_cache_oid($device, 'lgpPduRbTable', [], 'LIEBERT-GP-PDU-MIB', 'liebert', '-OQUse');
foreach (array_keys($rb_data) as $index) {
$low_limit_p = $rb_data[$index]['lgpPduRbEntryEcThrshldUndrAlm'] / 100;
$high_warn_limit_p = $rb_data[$index]['lgpPduRbEntryEcThrshldOvrWarn'] / 100;
$high_limit_p = $rb_data[$index]['lgpPduRbEntryEcThrshldOvrAlm'] / 100;
$oid = '.1.3.6.1.4.1.476.1.42.3.8.40.20.1.130.'.$index;
$type = 'liebert';
$descr = 'RMS ' . $rb_data[$index]['lgpPduRbEntryUsrLabel'];
$divisor = 100;
$multiplier = 1;
$low_limit = $ec_input_rated * $low_limit_p;
$low_warn_limit = null;
$high_warn_limit = $ec_input_rated * $high_warn_limit_p;
$high_limit = $ec_input_rated * $high_limit_p;
$current = $rb_data[$index]['lgpPduRbEntryEcHundredths'];
$group = 'Line to Neutral';
discover_sensor(
$valid['sensor'],
$class,
$device,
$oid,
$index.'lgpPduRbEntryEcHundredths',
$type,
$descr,
$divisor,
$multiplier,
$low_limit,
$low_warn_limit,
$high_warn_limit,
$high_limit,
$current,
$poller_type,
$entPhysicalIndex,
$entPhysicalIndex_measured,
$user_func,
$group
);
}
unset($rb_data);