mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Improved raritan pdu support (#12937)
* return "Outlet " + index in event outlet description is empty * update tests to account for blank outlet description * add hardware, serial, and version detection for Raritan PDUs
This commit is contained in:
parent
70023c0b59
commit
fcac1239fc
11
includes/definitions/discovery/raritan-pdu.yaml
Normal file
11
includes/definitions/discovery/raritan-pdu.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
modules:
|
||||
os:
|
||||
hardware:
|
||||
- .1.3.6.1.4.1.13742.6.3.2.1.1.3.1
|
||||
- .1.3.6.1.4.1.13742.4.1.1.12.0
|
||||
serial:
|
||||
- .1.3.6.1.4.1.13742.6.3.2.1.1.4.1
|
||||
- .1.3.6.1.4.1.13742.4.1.1.2.0
|
||||
version:
|
||||
- .1.3.6.1.4.1.13742.6.3.2.3.1.6.1.1.1
|
||||
- .1.3.6.1.4.1.13742.4.1.1.1.0
|
@ -66,7 +66,10 @@ if ($outlet_oids) {
|
||||
$outletsuffix = "$outlet_index";
|
||||
$outlet_insert_index = $outlet_index;
|
||||
$outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.1";
|
||||
$outlet_descr = snmp_get($device, ".1.3.6.1.4.1.13742.6.3.5.3.1.3.1.$outletsuffix", '-Ovq');
|
||||
$outlet_descr = snmp_get($device, "outletName.1.$outletsuffix", '-Ovq', 'PDU2-MIB');
|
||||
if (! $outlet_descr) {
|
||||
$outlet_descr = 'Outlet ' . $outletsuffix;
|
||||
}
|
||||
$outlet_low_warn_limit = snmp_get($device, "outletSensorSignedLowerWarningThreshold.1.$outlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB');
|
||||
$outlet_low_limit = snmp_get($device, "outletSensorSignedLowerCriticalThreshold.1.$outlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB');
|
||||
$outlet_high_warn_limit = snmp_get($device, "outletSensorSignedUpperWarningThreshold.1.$outlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB');
|
||||
|
@ -62,6 +62,9 @@ if ($outlet_oids) {
|
||||
$outlet_insert_index = $outlet_index;
|
||||
$outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.5";
|
||||
$outlet_descr = snmp_get($device, "outletName.1.$outletsuffix", '-Ovq', 'PDU2-MIB');
|
||||
if (! $outlet_descr) {
|
||||
$outlet_descr = 'Outlet ' . $outletsuffix;
|
||||
}
|
||||
$outlet_divisor = pow(10, snmp_get($device, "outletSensorDecimalDigits.1.$outlet_index.activePower", '-Ovq', 'PDU2-MIB'));
|
||||
$outlet_power = (snmp_get($device, "measurementsOutletSensorValue.1.$outlet_index.activePower", '-Ovq', 'PDU2-MIB') / $outlet_divisor);
|
||||
if ($outlet_power >= 0) {
|
||||
|
@ -30,7 +30,7 @@
|
||||
"sensor_oid": ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.1",
|
||||
"sensor_index": "1",
|
||||
"sensor_type": "raritan",
|
||||
"sensor_descr": "OUTLET1",
|
||||
"sensor_descr": "Outlet 1",
|
||||
"group": null,
|
||||
"sensor_divisor": 1000,
|
||||
"sensor_multiplier": 1,
|
||||
@ -390,7 +390,7 @@
|
||||
"sensor_oid": ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.5",
|
||||
"sensor_index": "1",
|
||||
"sensor_type": "raritan",
|
||||
"sensor_descr": "OUTLET1",
|
||||
"sensor_descr": "Outlet 1",
|
||||
"group": null,
|
||||
"sensor_divisor": 1,
|
||||
"sensor_multiplier": 1,
|
||||
@ -803,7 +803,7 @@
|
||||
"sensor_oid": ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.1",
|
||||
"sensor_index": "1",
|
||||
"sensor_type": "raritan",
|
||||
"sensor_descr": "OUTLET1",
|
||||
"sensor_descr": "Outlet 1",
|
||||
"group": null,
|
||||
"sensor_divisor": 1000,
|
||||
"sensor_multiplier": 1,
|
||||
@ -1163,7 +1163,7 @@
|
||||
"sensor_oid": ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.5",
|
||||
"sensor_index": "1",
|
||||
"sensor_type": "raritan",
|
||||
"sensor_descr": "OUTLET1",
|
||||
"sensor_descr": "Outlet 1",
|
||||
"group": null,
|
||||
"sensor_divisor": 1,
|
||||
"sensor_multiplier": 1,
|
||||
|
@ -185,7 +185,7 @@
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.2.1.10|4|10
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.2.1.11|4|11
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.2.1.12|4|12
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.3.1.1|4|OUTLET1
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.3.1.1|4|
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.3.1.2|4|OUTLET2
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.3.1.3|4|OUTLET3
|
||||
1.3.6.1.4.1.13742.6.3.5.3.1.3.1.4|4|OUTLET4
|
||||
|
Loading…
Reference in New Issue
Block a user