diff --git a/includes/definitions/discovery/edgeos-ep.yaml b/includes/definitions/discovery/edgeos-ep.yaml index 9fc05aacd0..b7c8a332ba 100644 --- a/includes/definitions/discovery/edgeos-ep.yaml +++ b/includes/definitions/discovery/edgeos-ep.yaml @@ -33,6 +33,21 @@ modules: num_oid: '.1.3.6.1.4.1.41112.1.5.3.2.1.5.{{ $index }}' index: 'ubntPsuVoltage.{{ $index }}' descr: 'Input Voltage PSU {{ $index }}' + charge: + data: + - + oid: ubntPsuBatteryChargeLevel + num_oid: '.1.3.6.1.4.1.41112.1.5.3.2.1.9.{{ $index }}' + index: 'ubntPsuBatteryChargeLevel.{{ $index }}' + descr: 'Charge percentage PSU {{ $index }}' + runtime: + data: + - + oid: ubntPsuBatteryTimeRemaining + divisor: 6000 + num_oid: '.1.3.6.1.4.1.41112.1.5.3.2.1.10.{{ $index }}' + index: 'ubntPsuBatteryTimeRemaining.{{ $index }}' + descr: 'Battery runtime remaining PSU {{ $index }}' current: data: - @@ -89,6 +104,16 @@ modules: - { descr: AC, graph: 0, value: 1, generic: 0 } - { descr: DC, graph: 0, value: 2, generic: 0 } - { descr: POE, graph: 0, value: 3, generic: 0 } + - + oid: ubntPsuBatteryReplaceIndicator + value: ubntPsuBatteryReplaceIndicator + num_oid: '.1.3.6.1.4.1.41112.1.5.3.2.1.11.{{ $index }}' + descr: 'Battery indicator PSU {{ $index }}' + index: '{{ $index }}' + states: + - { descr: unknown, graph: 0, value: 0, generic: 1 } + - { descr: OK, graph: 0, value: 1, generic: 0 } + - { descr: REPLACE, graph: 0, value: 2, generic: 1 } temperature: data: - diff --git a/mibs/ubnt/UBNT-EdgeMAX-MIB b/mibs/ubnt/UBNT-EdgeMAX-MIB index 757b9dd50b..c68092ce63 100644 --- a/mibs/ubnt/UBNT-EdgeMAX-MIB +++ b/mibs/ubnt/UBNT-EdgeMAX-MIB @@ -134,14 +134,18 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN ::= { ubntPsuTable 1 } UbntPsuEntry ::= SEQUENCE { - ubntPsuIndex Integer32, - ubntPsuType Integer32, - ubntPsuStatus Integer32, - ubntPsuOperStatus Integer32, - ubntPsuVoltage Integer32, - ubntPsuTemperature Integer32, - ubntPsuCharging Integer32, - ubntPsuBatteryQuantity Integer32 + ubntPsuIndex Integer32, + ubntPsuType INTEGER, + ubntPsuStatus INTEGER, + ubntPsuOperStatus INTEGER, + ubntPsuVoltage Integer32, + ubntPsuTemperature Integer32, + ubntPsuCharging INTEGER, + ubntPsuBatteryQuantity Integer32, + ubntPsuBatteryChargeLevel INTEGER, + ubntPsuBatteryTimeRemaining TimeTicks, + ubntPsuBatteryReplaceIndicator INTEGER, + ubntPsuBatteryLastReplaceDate DisplayString } ubntPsuIndex OBJECT-TYPE @@ -152,21 +156,21 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN ::= { ubntPsuEntry 1 } ubntPsuType OBJECT-TYPE - SYNTAX INTEGER { unknown(0),ac(1),dc(2),poe(3) } + SYNTAX INTEGER { unknown(0), ac(1), dc(2), poe(3) } MAX-ACCESS read-only STATUS current DESCRIPTION "PSU Type." ::= { ubntPsuEntry 2 } ubntPsuStatus OBJECT-TYPE - SYNTAX INTEGER { unknown(0),on(1),off(2),standby(3) } + SYNTAX INTEGER { unknown(0), on(1), off(2), standby(3) } MAX-ACCESS read-only STATUS current DESCRIPTION "PSU Status." ::= { ubntPsuEntry 3 } ubntPsuOperStatus OBJECT-TYPE - SYNTAX INTEGER { down(0),up(1) } + SYNTAX INTEGER { down(0), up(1) } MAX-ACCESS read-only STATUS current DESCRIPTION "PSU operational status." @@ -187,7 +191,7 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN ::= { ubntPsuEntry 6 } ubntPsuCharging OBJECT-TYPE - SYNTAX INTEGER { unknown(0),on(1),off(2) } + SYNTAX INTEGER { unknown(0), on(1), off(2) } MAX-ACCESS read-only STATUS current DESCRIPTION "Shows PSU charging state if it is supported." @@ -200,6 +204,34 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN DESCRIPTION "Number of batteries connected to PSU." ::= { ubntPsuEntry 8 } + ubntPsuBatteryChargeLevel OBJECT-TYPE + SYNTAX INTEGER (0..100) + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Current battery charge level as a percent (0-100%)." + ::= { ubntPsuEntry 9 } + + ubntPsuBatteryTimeRemaining OBJECT-TYPE + SYNTAX TimeTicks + MAX-ACCESS read-only + STATUS current + DESCRIPTION "The battery run time remaining before battery exhaustion." + ::= { ubntPsuEntry 10 } + + ubntPsuBatteryReplaceIndicator OBJECT-TYPE + SYNTAX INTEGER { unknown(0), noBatteryNeedsReplacing(1), batteryNeedsReplacing(2) } + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Indicates whether the batteries need replacing." + ::= { ubntPsuEntry 11 } + + ubntPsuBatteryLastReplaceDate OBJECT-TYPE + SYNTAX DisplayString + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Battery installation date (mm/dd/yyyy)." + ::= { ubntPsuEntry 12 } + -- -------------------------------------------------------------------------------- -- thermometers -- -------------------------------------------------------------------------------- @@ -242,7 +274,7 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN ::= { ubntThermsEntry 1 } ubntThermType OBJECT-TYPE - SYNTAX INTEGER { other(0),board(1),cpu(2),power(3) } + SYNTAX INTEGER { other(0), board(1), cpu(2), power(3) } MAX-ACCESS read-only STATUS current DESCRIPTION "Type of thermometer." @@ -297,7 +329,7 @@ UBNT-EdgeMAX-MIB DEFINITIONS ::= BEGIN ::= { ubntFanEntry 1 } ubntFanType OBJECT-TYPE - SYNTAX INTEGER { other(0),board(1),cpu(2),power(3) } + SYNTAX INTEGER { other(0), board(1), cpu(2), power(3) } MAX-ACCESS read-only STATUS current DESCRIPTION "Type of fan." diff --git a/tests/data/edgeos-ep.json b/tests/data/edgeos-ep.json index 3c04ca8415..9c3c81cfb8 100644 --- a/tests/data/edgeos-ep.json +++ b/tests/data/edgeos-ep.json @@ -692,6 +692,54 @@ "sensors": { "discovery": { "sensors": [ + { + "sensor_deleted": 0, + "sensor_class": "charge", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.9.1", + "sensor_index": "ubntPsuBatteryChargeLevel.1", + "sensor_type": "edgeos-ep", + "sensor_descr": "Charge percentage PSU 1", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 0, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": null + }, + { + "sensor_deleted": 0, + "sensor_class": "charge", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.9.2", + "sensor_index": "ubntPsuBatteryChargeLevel.2", + "sensor_type": "edgeos-ep", + "sensor_descr": "Charge percentage PSU 2", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 0, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": null + }, { "sensor_deleted": 0, "sensor_class": "count", @@ -812,6 +860,102 @@ "user_func": null, "state_name": null }, + { + "sensor_deleted": 0, + "sensor_class": "runtime", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.10.1", + "sensor_index": "ubntPsuBatteryTimeRemaining.1", + "sensor_type": "edgeos-ep", + "sensor_descr": "Battery runtime remaining PSU 1", + "group": null, + "sensor_divisor": 6000, + "sensor_multiplier": 1, + "sensor_current": 2, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": null + }, + { + "sensor_deleted": 0, + "sensor_class": "runtime", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.10.2", + "sensor_index": "ubntPsuBatteryTimeRemaining.2", + "sensor_type": "edgeos-ep", + "sensor_descr": "Battery runtime remaining PSU 2", + "group": null, + "sensor_divisor": 6000, + "sensor_multiplier": 1, + "sensor_current": 2, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": null + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.11.1", + "sensor_index": "1", + "sensor_type": "ubntPsuBatteryReplaceIndicator", + "sensor_descr": "Battery indicator PSU 1", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 0, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": "ubntPsuBatteryReplaceIndicator" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.41112.1.5.3.2.1.11.2", + "sensor_index": "2", + "sensor_type": "ubntPsuBatteryReplaceIndicator", + "sensor_descr": "Battery indicator PSU 2", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 0, + "sensor_limit": null, + "sensor_limit_warn": null, + "sensor_limit_low": null, + "sensor_limit_low_warn": null, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": "ubntPsuBatteryReplaceIndicator" + }, { "sensor_deleted": 0, "sensor_class": "state", @@ -1174,6 +1318,27 @@ } ], "state_indexes": [ + { + "state_name": "ubntPsuBatteryReplaceIndicator", + "state_descr": "unknown", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 1 + }, + { + "state_name": "ubntPsuBatteryReplaceIndicator", + "state_descr": "OK", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 0 + }, + { + "state_name": "ubntPsuBatteryReplaceIndicator", + "state_descr": "REPLACE", + "state_draw_graph": 0, + "state_value": 2, + "state_generic_value": 1 + }, { "state_name": "ubntPsuCharging", "state_descr": "unknown", diff --git a/tests/snmpsim/edgeos-ep.snmprec b/tests/snmpsim/edgeos-ep.snmprec index 8f29320b93..2a3e418b54 100644 --- a/tests/snmpsim/edgeos-ep.snmprec +++ b/tests/snmpsim/edgeos-ep.snmprec @@ -119,6 +119,12 @@ 1.3.6.1.4.1.41112.1.5.3.2.1.7.2|2|1 1.3.6.1.4.1.41112.1.5.3.2.1.8.1|2|0 1.3.6.1.4.1.41112.1.5.3.2.1.8.2|2|3 +1.3.6.1.4.1.41112.1.5.3.2.1.9.1|2|0 +1.3.6.1.4.1.41112.1.5.3.2.1.9.2|2|0 +1.3.6.1.4.1.41112.1.5.3.2.1.10.1|67|12000 +1.3.6.1.4.1.41112.1.5.3.2.1.10.2|67|12000 +1.3.6.1.4.1.41112.1.5.3.2.1.11.1|2|0 +1.3.6.1.4.1.41112.1.5.3.2.1.11.2|2|0 1.3.6.1.4.1.41112.1.5.4.2.1.3.1|2|18500 1.3.6.1.4.1.41112.1.5.4.2.1.3.2|2|25500 1.3.6.1.4.1.41112.1.5.4.2.1.3.3|2|23500