From cd7aa5e65d070378ac93f8f0ff330189d314fac2 Mon Sep 17 00:00:00 2001 From: Dan Baker <16193241+bakerds@users.noreply.github.com> Date: Thu, 2 Mar 2023 04:16:54 -0500 Subject: [PATCH] Added PoE controller load and status sensors for Junos devices (#14868) --- includes/definitions/discovery/junos.yaml | 23 +++- tests/data/junos_ex.json | 121 ++++++++++++++++++++++ tests/snmpsim/junos_ex.snmprec | 9 ++ 3 files changed, 152 insertions(+), 1 deletion(-) diff --git a/includes/definitions/discovery/junos.yaml b/includes/definitions/discovery/junos.yaml index e9229182fd..84ebd74337 100644 --- a/includes/definitions/discovery/junos.yaml +++ b/includes/definitions/discovery/junos.yaml @@ -1,4 +1,4 @@ -mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB:JUNIPER-MIB:JUNIPER-SRX5000-SPU-MONITORING-MIB:JUNIPER-ALARM-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-RPM-MIB +mib: JUNIPER-IFOPTICS-MIB:JNX-OPT-IF-EXT-MIB:IF-MIB:JUNIPER-MIB:JUNIPER-SRX5000-SPU-MONITORING-MIB:JUNIPER-ALARM-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-VIRTUALCHASSIS-MIB:JUNIPER-RPM-MIB:POWER-ETHERNET-MIB modules: mempools: data: @@ -228,3 +228,24 @@ modules: - { value: 1, generic: 0, graph: 0, descr: master } - { value: 2, generic: 0, graph: 0, descr: backup } - { value: 3, generic: 0, graph: 0, descr: linecard } + - + oid: POWER-ETHERNET-MIB::pethMainPseTable + value: POWER-ETHERNET-MIB::pethMainPseOperStatus + num_oid: '.1.3.6.1.2.1.105.1.3.1.1.3.{{ $index }}' + descr: 'PoE Controller {{ $index }} Status' + index: 'pethMainPseOperStatus.{{ $index }}' + states: + - { value: 1, generic: 0, graph: 0, descr: on } + - { value: 2, generic: 0, graph: 0, descr: off } + - { value: 3, generic: 2, graph: 0, descr: fault } + power: + data: + - + oid: POWER-ETHERNET-MIB::pethMainPseTable + value: POWER-ETHERNET-MIB::pethMainPseConsumptionPower + num_oid: '.1.3.6.1.2.1.105.1.3.1.1.4.{{ $index }}' + descr: 'PoE Controller {{ $index }} Load' + index: 'pethMainPseConsumptionPower.{{ $index }}' + high_limit: POWER-ETHERNET-MIB::pethMainPsePower + low_limit: -1 + low_warn_limit: -1 \ No newline at end of file diff --git a/tests/data/junos_ex.json b/tests/data/junos_ex.json index 89445e74a6..6b203d5f8c 100644 --- a/tests/data/junos_ex.json +++ b/tests/data/junos_ex.json @@ -247,6 +247,56 @@ "sensors": { "discovery": { "sensors": [ + { + "sensor_deleted": 0, + "sensor_class": "power", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.2.1.105.1.3.1.1.4.1", + "sensor_index": "pethMainPseConsumptionPower.1", + "sensor_type": "junos", + "sensor_descr": "PoE Controller 1 Load", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 248, + "sensor_limit": 1764, + "sensor_limit_warn": null, + "sensor_limit_low": -1, + "sensor_limit_low_warn": -1, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "rrd_type": "GAUGE", + "state_name": null + }, + { + "sensor_deleted": 0, + "sensor_class": "power", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.2.1.105.1.3.1.1.4.2", + "sensor_index": "pethMainPseConsumptionPower.2", + "sensor_type": "junos", + "sensor_descr": "PoE Controller 2 Load", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 137, + "sensor_limit": 767, + "sensor_limit_warn": null, + "sensor_limit_low": -1, + "sensor_limit_low_warn": -1, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "rrd_type": "GAUGE", + "state_name": null + }, { "sensor_deleted": 0, "sensor_class": "state", @@ -522,6 +572,56 @@ "rrd_type": "GAUGE", "state_name": "jnxYellowAlarmState" }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.2.1.105.1.3.1.1.3.1", + "sensor_index": "pethMainPseOperStatus.1", + "sensor_type": "POWER-ETHERNET-MIB::pethMainPseTable", + "sensor_descr": "PoE Controller 1 Status", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 1, + "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, + "rrd_type": "GAUGE", + "state_name": "POWER-ETHERNET-MIB::pethMainPseTable" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.2.1.105.1.3.1.1.3.2", + "sensor_index": "pethMainPseOperStatus.2", + "sensor_type": "POWER-ETHERNET-MIB::pethMainPseTable", + "sensor_descr": "PoE Controller 2 Status", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 1, + "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, + "rrd_type": "GAUGE", + "state_name": "POWER-ETHERNET-MIB::pethMainPseTable" + }, { "sensor_deleted": 0, "sensor_class": "temperature", @@ -685,6 +785,27 @@ "state_draw_graph": 1, "state_value": 3, "state_generic_value": 2 + }, + { + "state_name": "POWER-ETHERNET-MIB::pethMainPseTable", + "state_descr": "on", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 0 + }, + { + "state_name": "POWER-ETHERNET-MIB::pethMainPseTable", + "state_descr": "off", + "state_draw_graph": 0, + "state_value": 2, + "state_generic_value": 0 + }, + { + "state_name": "POWER-ETHERNET-MIB::pethMainPseTable", + "state_descr": "fault", + "state_draw_graph": 0, + "state_value": 3, + "state_generic_value": 2 } ] }, diff --git a/tests/snmpsim/junos_ex.snmprec b/tests/snmpsim/junos_ex.snmprec index 531cedfab9..56806f33d1 100644 --- a/tests/snmpsim/junos_ex.snmprec +++ b/tests/snmpsim/junos_ex.snmprec @@ -37,6 +37,14 @@ 1.3.6.1.2.1.15.3.1.24.192.168.1.186|66|785386 1.3.6.1.2.1.15.3.1.24.192.168.1.226|66|774040 1.3.6.1.2.1.25.1.1.0|67|2376182110 +1.3.6.1.2.1.105.1.3.1.1.2.1|66|1764 +1.3.6.1.2.1.105.1.3.1.1.2.2|66|767 +1.3.6.1.2.1.105.1.3.1.1.3.1|2|1 +1.3.6.1.2.1.105.1.3.1.1.3.2|2|1 +1.3.6.1.2.1.105.1.3.1.1.4.1|66|248 +1.3.6.1.2.1.105.1.3.1.1.4.2|66|137 +1.3.6.1.2.1.105.1.3.1.1.5.1|2|80 +1.3.6.1.2.1.105.1.3.1.1.5.2|2|80 1.3.6.1.4.1.2636.3.1.13.1.5.1.1.0.0|4| 1.3.6.1.4.1.2636.3.1.13.1.5.2.1.1.0|4|Power Supply 0 @ 0/0/* 1.3.6.1.4.1.2636.3.1.13.1.5.2.1.2.0|4|Power Supply 1 @ 0/1/* @@ -280,3 +288,4 @@ 1.3.6.1.4.1.2636.3.4.2.2.1.0|2|2 1.3.6.1.4.1.2636.3.4.2.3.1.0|2|2 1.3.6.1.6.3.10.2.1.3.0|2|7924700 +