Skip to content

Commit 9a20f14

Browse files
rudybroersmalaf
andauthored
Add battery health sensors for Eaton UPS M2 (librenms#17423)
* Eaton UPS M2 (and M3) card update Add battery last replacement date sensor & low battery capacity threshold sensor * Testsss * Delete tests/data/eatonupsm2.yaml * Update eatonupsm2_9px+empg2.json * Update eatonupsm2_9px+empg2.json * Update eatonupsm2_9px.json --------- Co-authored-by: Neil Lathwood <[email protected]>
1 parent 9190625 commit 9a20f14

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

includes/definitions/discovery/eatonupsm2.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ modules:
99
- XUPS-MIB::xupsAgentSoftwareVersion.0
1010
features_template: '{{ XUPS-MIB::xupsAgentModel.0 }} {{ XUPS-MIB::xupsAgentSoftwareVersion.0 }}'
1111
sensors:
12+
runtime:
13+
data:
14+
-
15+
oid: xupsBatteryLastReplacedDate
16+
value: xupsBatteryLastReplacedDate
17+
num_oid: '.1.3.6.1.4.1.534.1.2.6.{{ $index }}'
18+
descr: 'Last battery replacement'
19+
index: 'xupsBatteryLastReplacedDate.{{ $index }}'
20+
user_func: dateToRuntime
1221
temperature:
1322
data:
1423
-
@@ -42,3 +51,12 @@ modules:
4251
states:
4352
- { value: 1, descr: open, graph: 1, generic: 2 }
4453
- { value: 2, descr: closed, graph: 1, generic: 2 }
54+
-
55+
oid: xupsBatteryLowCapacity
56+
value: xupsBatteryLowCapacity
57+
num_oid: '.1.3.6.1.4.1.534.1.2.10.{{ $index }}'
58+
descr: 'Battery Low Capacity Warning'
59+
index: 'xupsBatteryLowCapacity.{{ $index }}'
60+
states:
61+
- { value: 1, descr: Yes, graph: 1, generic: 1 }
62+
- { value: 2, descr: No, graph: 1, generic: 0 }

tests/data/eatonupsm2_9px+empg2.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,31 @@
10081008
"rrd_type": "GAUGE",
10091009
"state_name": null
10101010
},
1011+
{
1012+
"sensor_deleted": 0,
1013+
"sensor_class": "runtime",
1014+
"poller_type": "snmp",
1015+
"sensor_oid": ".1.3.6.1.4.1.534.1.2.6.0",
1016+
"sensor_index": "xupsBatteryLastReplacedDate.0",
1017+
"sensor_type": "eatonupsm2",
1018+
"sensor_descr": "Last battery replacement",
1019+
"group": null,
1020+
"sensor_divisor": 1,
1021+
"sensor_multiplier": 1,
1022+
"sensor_current": 1380960,
1023+
"sensor_limit": null,
1024+
"sensor_limit_warn": null,
1025+
"sensor_limit_low": null,
1026+
"sensor_limit_low_warn": null,
1027+
"sensor_alert": 1,
1028+
"sensor_custom": "No",
1029+
"entPhysicalIndex": null,
1030+
"entPhysicalIndex_measured": null,
1031+
"sensor_prev": null,
1032+
"user_func": "dateToRuntime",
1033+
"rrd_type": "GAUGE",
1034+
"state_name": null
1035+
},
10111036
{
10121037
"sensor_deleted": 0,
10131038
"sensor_class": "runtime",
@@ -1133,6 +1158,31 @@
11331158
"rrd_type": "GAUGE",
11341159
"state_name": "upsTestResult"
11351160
},
1161+
{
1162+
"sensor_deleted": 0,
1163+
"sensor_class": "state",
1164+
"poller_type": "snmp",
1165+
"sensor_oid": ".1.3.6.1.4.1.534.1.2.10.0",
1166+
"sensor_index": "xupsBatteryLowCapacity.0",
1167+
"sensor_type": "xupsBatteryLowCapacity",
1168+
"sensor_descr": "Battery Low Capacity Warning",
1169+
"group": null,
1170+
"sensor_divisor": 1,
1171+
"sensor_multiplier": 1,
1172+
"sensor_current": 2,
1173+
"sensor_limit": null,
1174+
"sensor_limit_warn": null,
1175+
"sensor_limit_low": null,
1176+
"sensor_limit_low_warn": null,
1177+
"sensor_alert": 1,
1178+
"sensor_custom": "No",
1179+
"entPhysicalIndex": null,
1180+
"entPhysicalIndex_measured": null,
1181+
"sensor_prev": null,
1182+
"user_func": null,
1183+
"rrd_type": "GAUGE",
1184+
"state_name": "xupsBatteryLowCapacity"
1185+
},
11361186
{
11371187
"sensor_deleted": 0,
11381188
"sensor_class": "state",
@@ -1429,6 +1479,20 @@
14291479
"state_value": 6,
14301480
"state_generic_value": 3
14311481
},
1482+
{
1483+
"state_name": "xupsBatteryLowCapacity",
1484+
"state_descr": "Yes",
1485+
"state_draw_graph": 1,
1486+
"state_value": 1,
1487+
"state_generic_value": 1
1488+
},
1489+
{
1490+
"state_name": "xupsBatteryLowCapacity",
1491+
"state_descr": "No",
1492+
"state_draw_graph": 1,
1493+
"state_value": 2,
1494+
"state_generic_value": 0
1495+
},
14321496
{
14331497
"state_name": "xupsEnvironment",
14341498
"state_descr": "open",

0 commit comments

Comments
 (0)