diff --git a/html/images/os/bke.png b/html/images/os/bke.png new file mode 100644 index 0000000000..89027262ff Binary files /dev/null and b/html/images/os/bke.png differ diff --git a/includes/definitions/bke.yaml b/includes/definitions/bke.yaml new file mode 100644 index 0000000000..31d5010f0a --- /dev/null +++ b/includes/definitions/bke.yaml @@ -0,0 +1,8 @@ +os: bke +text: 'BKE' +type: power +icon: bke +group: bke +discovery: + - sysObjectID: + - .1.3.6.1.4.1.27533 diff --git a/includes/definitions/discovery/bke.yaml b/includes/definitions/discovery/bke.yaml new file mode 100644 index 0000000000..0b4eebf0f0 --- /dev/null +++ b/includes/definitions/discovery/bke.yaml @@ -0,0 +1,97 @@ +mib: PNETMOD-MIB +modules: + sensors: + temperature: + data: + - + oid: accuTemperature + num_oid: '.1.3.6.1.4.1.27533.5.3.3.{{ $index }}' + index: accuTemperature.{{index}} + descr: Temperature + divisor: 10 + + skip_values: + - + oid: accuTemperature + op: '>=' + value: 100000 + + state: + data: + - + oid: powerSourceState + num_oid: '.1.3.6.1.4.1.27533.5.2.1.{{ $index }}' + index: powerSourceState.{{index}} + descr: 'Power state' + states: + - { descr: Battery, graph: 0, value: 1, generic: 1 } + - { descr: Online, graph: 0, value: 0, generic: 0 } + - + oid: gridState + num_oid: '.1.3.6.1.4.1.27533.5.1.1.{{ $index }}' + index: gridState.{{index}} + descr: 'Grid state' + states: + - { descr: Fail, graph: 0, value: 1, generic: 1 } + - { descr: Ok, graph: 0, value: 0, generic: 0 } + - + oid: gridFuse + num_oid: '.1.3.6.1.4.1.27533.5.1.2.{{ $index }}' + index: gridFuse.{{index}} + descr: 'Grid fuse state' + states: + - { descr: Fail, graph: 0, value: 1, generic: 1 } + - { descr: Ok, graph: 0, value: 0, generic: 0 } + - + oid: outState + num_oid: '.1.3.6.1.4.1.27533.5.4.2.{{ $index }}' + index: outState.{{index}} + descr: 'Output state' + states: + - { descr: On, graph: 0, value: 1, generic: 0 } + - { descr: Off, graph: 0, value: 2, generic: 1 } + - + oid: outFuse + num_oid: '.1.3.6.1.4.1.27533.5.4.1.{{ $index }}' + index: outFuse.{{index}} + descr: 'Output fuse state' + states: + - { descr: Fail, graph: 0, value: 1, generic: 1 } + - { descr: Ok, graph: 0, value: 0, generic: 0 } + - + oid: accuFuse + num_oid: '.1.3.6.1.4.1.27533.5.3.4.{{ $index }}' + index: accuFuse.{{index}} + descr: 'Accumulator fuse state' + states: + - { descr: Fail, graph: 0, value: 1, generic: 1 } + - { descr: Ok, graph: 0, value: 0, generic: 0 } + + current: + data: + - + oid: powerSourceCurrent + num_oid: '.1.3.6.1.4.1.27533.5.2.2.{{ $index }}' + index: 'powerSourceCurrent.{{ $index }}' + descr: 'Power source current' + divisor: 10 + - + oid: accuCurrent + num_oid: '.1.3.6.1.4.1.27533.5.3.2.{{ $index }}' + index: 'accuCurrent.{{ $index }}' + descr: 'Charge current' + divisor: 10 + + voltage: + data: + - + oid: accuVoltage + num_oid: '.1.3.6.1.4.1.27533.5.3.1.{{ $index }}' + index: 'accuVoltage.{{ $index }}' + descr: 'Voltage' + divisor: 10 + low_warn_limit: 42 + low_limit: 41 + warn_limit: 57 + high_limit: 60 + diff --git a/mibs/bke/PNETMOD-MIB b/mibs/bke/PNETMOD-MIB new file mode 100644 index 0000000000..3135e6d478 --- /dev/null +++ b/mibs/bke/PNETMOD-MIB @@ -0,0 +1,255 @@ +-- PNETMOD-MIB 1.02 +-- History: +-- 1.00 6. 11.2012 David Chvalkovsky - modified from NSD1800-MIB +-- 1.01 9. 12.2015 Dusan Ferbas - comment compatibility +-- 1.02 19. 10.2017 Vit Pekarek - Output Fuse description fixed +-- +-- This is a MIB for Powernet module + + +PNETMOD-MIB DEFINITIONS ::= BEGIN +IMPORTS + OBJECT-TYPE + FROM RFC-1212 + Gauge, enterprises + FROM RFC1155-SMI + DisplayString, sysName + FROM RFC1213-MIB; + +-- +-- Type Definitions +-- + +OnOff ::= INTEGER { + off (0), + on (1) + } + +OKFail ::= INTEGER { + OK (0), + Fail (1) + } + +ValueType ::= INTEGER { + DI (1), + AI (2) + } + +AlarmDescription ::= INTEGER { + InputGridFailure (1), + InputFuseFailure (2), + PowerSourceFailure (3), + PowerSourceCurrentOutOfRange (4), + BatteryVoltageOutOfRange (5), + BatteryCurrentChargeOutOfRange (6), + BatteryTemperatureOutOfRange (7), + BatteryFuseFailure (8), + OutputFuseFailure (9), + OutputStateDisconnected (10) + } + +SignedNumber ::= INTEGER (-32758..32757) + +Index ::= INTEGER (0..255) + +TimeStamp ::= TimeTicks + +-- +-- Node Definitions +-- + +bke OBJECT IDENTIFIER ::= { enterprises 27533 } + +pnetMod OBJECT IDENTIFIER ::= { bke 5 } + +-- ---------------------------------------------------------- -- +-- grid Group +-- ---------------------------------------------------------- -- +grid OBJECT IDENTIFIER ::= { pnetMod 1 } + +gridState OBJECT-TYPE + SYNTAX OKFail + ACCESS read-only + STATUS current + DESCRIPTION + "Grid State Ok/Fail value" + ::= { grid 1 } + +gridFuse OBJECT-TYPE + SYNTAX OKFail + ACCESS read-only + STATUS current + DESCRIPTION + "Grid Fuse Ok/Fail value" + ::= { grid 2 } + +-- ---------------------------------------------------------- -- +-- source Group +-- ---------------------------------------------------------- -- +powerSource OBJECT IDENTIFIER ::= { pnetMod 2 } + +powerSourceState OBJECT-TYPE + SYNTAX OKFail + ACCESS read-only + STATUS current + DESCRIPTION + "Power Source State Ok/Fail value" + ::= { powerSource 1 } + +powerSourceCurrent OBJECT-TYPE + SYNTAX SignedNumber + ACCESS read-only + STATUS current + DESCRIPTION + "Power Source Current value XXXX divide by 10 to get XXX.X" + ::= { powerSource 2 } + +-- ---------------------------------------------------------- -- +-- accumulator Group +-- ---------------------------------------------------------- -- +accumulator OBJECT IDENTIFIER ::= { pnetMod 3 } + +accuVoltage OBJECT-TYPE + SYNTAX SignedNumber + ACCESS read-only + STATUS current + DESCRIPTION + "Accumulator Voltage value XXXX divide by 10 to get XXX.X" + ::= { accumulator 1 } + +accuCurrent OBJECT-TYPE + SYNTAX SignedNumber + ACCESS read-only + STATUS current + DESCRIPTION + "Accumulator Current value XXXX divide by 10 to get XXX.X" + ::= { accumulator 2 } + +accuTemperature OBJECT-TYPE + SYNTAX SignedNumber + ACCESS read-only + STATUS current + DESCRIPTION + "Accumulator Temperature value -XXX divide by 10 to get -XX.X" + ::= { accumulator 3 } + +accuFuse OBJECT-TYPE + SYNTAX OKFail + ACCESS read-only + STATUS current + DESCRIPTION + "Accumulator Fuse Ok/Fail value" + ::= { accumulator 4 } + +-- ---------------------------------------------------------- -- +-- output Group +-- ---------------------------------------------------------- -- +output OBJECT IDENTIFIER ::= { pnetMod 4 } + +outFuse OBJECT-TYPE + SYNTAX OKFail + ACCESS read-only + STATUS current + DESCRIPTION + "Output Fuse Ok/Fail value" + ::= { output 1 } + +outState OBJECT-TYPE + SYNTAX OnOff + ACCESS read-write + STATUS current + DESCRIPTION + "Output State On/Off value" + ::= { output 2 } + +-- ---------------------------------------------------------- -- +-- Alarm Group +-- ---------------------------------------------------------- -- +alarms OBJECT IDENTIFIER ::= { pnetMod 10 } + +alarmTable OBJECT-TYPE + SYNTAX SEQUENCE OF AlarmEntry + ACCESS not-accessible + STATUS current + DESCRIPTION + "A list of input entries." + ::= { alarms 1 } + +alarmEntry OBJECT-TYPE + SYNTAX AlarmEntry + ACCESS not-accessible + STATUS current + DESCRIPTION + "An entry containing information applicable + to a particular input." + INDEX { alarmIndex } + ::= { alarmTable 1 } + +AlarmEntry ::= SEQUENCE { + alarmIndex Index, + alarmDescription AlarmDescription, + valueType ValueType, + value SignedNumber, + alarmTimeStamp TimeStamp +} + +alarmIndex OBJECT-TYPE + SYNTAX Index + ACCESS read-only + STATUS current + DESCRIPTION + "The input index." + ::= { alarmEntry 1 } + +alarmDescription OBJECT-TYPE + SYNTAX AlarmDescription + ACCESS read-only + STATUS current + DESCRIPTION + "The input alarm description." + ::= { alarmEntry 2 } + +valueType OBJECT-TYPE + SYNTAX ValueType + ACCESS read-only + STATUS current + DESCRIPTION + "The input digital or analog type." + ::= { alarmEntry 3 } + +value OBJECT-TYPE + SYNTAX SignedNumber + ACCESS read-only + STATUS current + DESCRIPTION + "The input alarm value." + ::= { alarmEntry 4 } + +alarmTimeStamp OBJECT-TYPE + SYNTAX TimeStamp + ACCESS read-only + STATUS current + DESCRIPTION + "The input alarm duration." + ::= { alarmEntry 5 } + +-- ---------------------------------------------------------- -- +-- Trap Definitions +-- ---------------------------------------------------------- -- +tsTrapAlarmStart TRAP-TYPE + ENTERPRISE pnetMod + VARIABLES { sysName, alarmDescription, valueType, value } + DESCRIPTION + "This trap is sent each time an alarm is inserted + into the alarm table." + ::= 1 + +tsTrapAlarmEnd TRAP-TYPE + ENTERPRISE pnetMod + VARIABLES { sysName, alarmDescription, valueType, value } + DESCRIPTION + "This trap is sent each time an alarm is removed + from the alarm table." + ::= 2 + +END diff --git a/tests/data/bke_bke.json b/tests/data/bke_bke.json new file mode 100644 index 0000000000..131d2fc371 --- /dev/null +++ b/tests/data/bke_bke.json @@ -0,0 +1,356 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.27533.5", + "sysDescr": "ETH_mod SNMP Supervisor v1.1.10b13", + "sysContact": "", + "version": null, + "hardware": null, + "features": null, + "os": "bke", + "type": "power", + "serial": null, + "icon": "bke.png", + "location": "" + } + ] + }, + "poller": "matches discovery" + }, + "sensors": { + "discovery": { + "sensors": [ + { + "sensor_deleted": 0, + "sensor_class": "current", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.3.2.0", + "sensor_index": "accuCurrent.0", + "sensor_type": "bke", + "sensor_descr": "Charge current", + "group": null, + "sensor_divisor": 10, + "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": "current", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.2.2.0", + "sensor_index": "powerSourceCurrent.0", + "sensor_type": "bke", + "sensor_descr": "Power source current", + "group": null, + "sensor_divisor": 10, + "sensor_multiplier": 1, + "sensor_current": 4.7, + "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.27533.5.3.4.0", + "sensor_index": "accuFuse.{{index}}", + "sensor_type": "accuFuse", + "sensor_descr": "Accumulator fuse state", + "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": "accuFuse" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.1.2.0", + "sensor_index": "gridFuse.{{index}}", + "sensor_type": "gridFuse", + "sensor_descr": "Grid fuse state", + "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": "gridFuse" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.1.1.0", + "sensor_index": "gridState.{{index}}", + "sensor_type": "gridState", + "sensor_descr": "Grid state", + "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": "gridState" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.4.1.0", + "sensor_index": "outFuse.{{index}}", + "sensor_type": "outFuse", + "sensor_descr": "Output fuse state", + "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": "outFuse" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.4.2.0", + "sensor_index": "outState.{{index}}", + "sensor_type": "outState", + "sensor_descr": "Output state", + "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, + "state_name": "outState" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.2.1.0", + "sensor_index": "powerSourceState.{{index}}", + "sensor_type": "powerSourceState", + "sensor_descr": "Power state", + "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": "powerSourceState" + }, + { + "sensor_deleted": 0, + "sensor_class": "temperature", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.3.3.0", + "sensor_index": "accuTemperature.{{index}}", + "sensor_type": "bke", + "sensor_descr": "Temperature", + "group": null, + "sensor_divisor": 10, + "sensor_multiplier": 1, + "sensor_current": 20.8, + "sensor_limit": 40.8, + "sensor_limit_warn": null, + "sensor_limit_low": 10.8, + "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": "voltage", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.27533.5.3.1.0", + "sensor_index": "accuVoltage.0", + "sensor_type": "bke", + "sensor_descr": "Voltage", + "group": null, + "sensor_divisor": 10, + "sensor_multiplier": 1, + "sensor_current": 54.9, + "sensor_limit": 60, + "sensor_limit_warn": 57, + "sensor_limit_low": 41, + "sensor_limit_low_warn": 42, + "sensor_alert": 1, + "sensor_custom": "No", + "entPhysicalIndex": null, + "entPhysicalIndex_measured": null, + "sensor_prev": null, + "user_func": null, + "state_name": null + } + ], + "state_indexes": [ + { + "state_name": "accuFuse", + "state_descr": "Ok", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "accuFuse", + "state_descr": "Fail", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 1 + }, + { + "state_name": "gridFuse", + "state_descr": "Ok", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "gridFuse", + "state_descr": "Fail", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 1 + }, + { + "state_name": "gridState", + "state_descr": "Ok", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "gridState", + "state_descr": "Fail", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 1 + }, + { + "state_name": "outFuse", + "state_descr": "Ok", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "outFuse", + "state_descr": "Fail", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 1 + }, + { + "state_name": "outState", + "state_descr": "On", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 0 + }, + { + "state_name": "outState", + "state_descr": "Off", + "state_draw_graph": 0, + "state_value": 2, + "state_generic_value": 1 + }, + { + "state_name": "powerSourceState", + "state_descr": "Online", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "powerSourceState", + "state_descr": "Battery", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 1 + } + ] + }, + "poller": "matches discovery" + } +} diff --git a/tests/snmpsim/bke_bke.snmprec b/tests/snmpsim/bke_bke.snmprec new file mode 100644 index 0000000000..29e08bc74d --- /dev/null +++ b/tests/snmpsim/bke_bke.snmprec @@ -0,0 +1,43 @@ +1.3.6.1.2.1.1.1.0|4|ETH_mod SNMP Supervisor v1.1.10b13 +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.27533.5 +1.3.6.1.2.1.1.3.0|67|1158460 +1.3.6.1.2.1.1.4.0|4| +1.3.6.1.2.1.1.5.0|4| +1.3.6.1.2.1.1.6.0|4| +1.3.6.1.2.1.11.1.0|65|7658 +1.3.6.1.2.1.11.2.0|65|5704 +1.3.6.1.2.1.11.3.0|65|699 +1.3.6.1.2.1.11.4.0|65|0 +1.3.6.1.2.1.11.5.0|65|0 +1.3.6.1.2.1.11.6.0|65|1257 +1.3.6.1.2.1.11.8.0|65|0 +1.3.6.1.2.1.11.9.0|65|3764 +1.3.6.1.2.1.11.10.0|65|0 +1.3.6.1.2.1.11.11.0|65|0 +1.3.6.1.2.1.11.12.0|65|0 +1.3.6.1.2.1.11.13.0|65|2443 +1.3.6.1.2.1.11.14.0|65|0 +1.3.6.1.2.1.11.15.0|65|4458 +1.3.6.1.2.1.11.16.0|65|1497 +1.3.6.1.2.1.11.17.0|65|0 +1.3.6.1.2.1.11.18.0|65|0 +1.3.6.1.2.1.11.19.0|65|0 +1.3.6.1.2.1.11.20.0|65|0 +1.3.6.1.2.1.11.21.0|65|0 +1.3.6.1.2.1.11.22.0|65|0 +1.3.6.1.2.1.11.24.0|65|0 +1.3.6.1.2.1.11.25.0|65|0 +1.3.6.1.2.1.11.26.0|65|0 +1.3.6.1.2.1.11.27.0|65|0 +1.3.6.1.2.1.11.28.0|65|5726 +1.3.6.1.2.1.11.29.0|65|2 +1.3.6.1.4.1.27533.5.1.1.0|2|0 +1.3.6.1.4.1.27533.5.1.2.0|2|0 +1.3.6.1.4.1.27533.5.2.1.0|2|0 +1.3.6.1.4.1.27533.5.2.2.0|2|47 +1.3.6.1.4.1.27533.5.3.1.0|2|549 +1.3.6.1.4.1.27533.5.3.2.0|2|0 +1.3.6.1.4.1.27533.5.3.3.0|2|208 +1.3.6.1.4.1.27533.5.3.4.0|2|0 +1.3.6.1.4.1.27533.5.4.1.0|2|0 +1.3.6.1.4.1.27533.5.4.2.0|2|1