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:
d-k-7 2021-06-08 18:38:23 -04:00 committed by GitHub
parent 70023c0b59
commit fcac1239fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 6 deletions

View 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

View File

@ -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');

View File

@ -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) {

View File

@ -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,

View File

@ -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