diff --git a/includes/definitions/discovery/hwg-ste.yaml b/includes/definitions/discovery/hwg-ste.yaml index f227fa67fe..1276582fc9 100644 --- a/includes/definitions/discovery/hwg-ste.yaml +++ b/includes/definitions/discovery/hwg-ste.yaml @@ -61,9 +61,7 @@ modules: states: - { descr: invalid, graph: 0, value: 0, generic: 2 } - { descr: normal, graph: 0, value: 1, generic: 0 } - - { descr: outofrangelo, graph: 0, value: 2, generic: 2 } - - { descr: outofrangehi, graph: 0, value: 3, generic: 2 } - - { descr: alarmlo, graph: 0, value: 4, generic: 2 } - - { descr: alarmhi, graph: 0, value: 5, generic: 2 } - - + - { descr: outOfRangeLo, graph: 0, value: 2, generic: 2 } + - { descr: outofRangeHi, graph: 0, value: 3, generic: 2 } + - { descr: alarmLo, graph: 0, value: 4, generic: 2 } + - { descr: alarmHi, graph: 0, value: 5, generic: 2 } diff --git a/includes/definitions/discovery/hwg-wld.yaml b/includes/definitions/discovery/hwg-wld.yaml new file mode 100644 index 0000000000..11a8c790bf --- /dev/null +++ b/includes/definitions/discovery/hwg-wld.yaml @@ -0,0 +1,31 @@ +mib: HWg-WLD-MIB +modules: + os: + serial: + - HWg-WLD-MIB::wldSN.1 + sensors: + state: + data: + - + oid: wldTable + value: wldState + num_oid: '.1.3.6.1.4.1.21796.4.5.4.1.3.{{ $index }}' + descr: '"{{ $wldName }}" state' + index: 'wldState.{{ $index }}' + state_name: wldState + states: + - { descr: invalid, graph: 0, value: 0, generic: 2 } + - { descr: normal, graph: 0, value: 1, generic: 0 } + - { descr: alarm, graph: 0, value: 3, generic: 2 } + - + oid: wldTable + value: wldValue + num_oid: '.1.3.6.1.4.1.21796.4.5.4.1.6.{{ $index }}' + descr: '"{{ $wldName }}" detailed state' + index: 'wldValue.{{ $index }}' + state_name: wldValue + states: + - { descr: disconnect, graph: 0, value: 2, generic: 3 } + - { descr: flooded, graph: 0, value: 1, generic: 2 } + - { descr: normal, graph: 0, value: 0, generic: 0 } + - { descr: invalid, graph: 0, value: 3, generic: 2 } diff --git a/includes/definitions/hwg-ste.yaml b/includes/definitions/hwg-ste.yaml index 9f9676fbe1..3bc76492c3 100644 --- a/includes/definitions/hwg-ste.yaml +++ b/includes/definitions/hwg-ste.yaml @@ -2,9 +2,9 @@ os: hwg-ste text: 'HWg STE' type: environment icon: hwg +mib_dir: hwg over: - { graph: device_temperature, text: Temperature } -mib_dir: hwg nobulk: true poller_modules: applications: false @@ -38,3 +38,5 @@ discovery: - sysObjectID: - .1.3.6.1.4.1.21796.4.1 + sysDescr_except: + - 'HWg-WLD' diff --git a/includes/definitions/hwg-wld.yaml b/includes/definitions/hwg-wld.yaml new file mode 100644 index 0000000000..dfc6cadf44 --- /dev/null +++ b/includes/definitions/hwg-wld.yaml @@ -0,0 +1,21 @@ +os: hwg-wld +text: 'HWg WLD' +type: environment +icon: hwg +mib_dir: hwg +over: + - { graph: device_state, text: States } +nobulk: true +poller_modules: + stp: false + ucd-mib: false + ports: false +discovery_modules: + stp: false + ports: false +discovery: + - + sysObjectID: + - .1.3.6.1.4.1.21796.4.1 + sysDescr: + - 'HWg-WLD' diff --git a/mibs/hwg/HWg-WLD-MIB b/mibs/hwg/HWg-WLD-MIB new file mode 100644 index 0000000000..016cb4b7d6 --- /dev/null +++ b/mibs/hwg/HWg-WLD-MIB @@ -0,0 +1,162 @@ +-- HWg-WLD MIB 1.01 +-- History: +-- +-- 1.00 27.11.2009 Marek Hummel - Created +-- 1.01 2.8.2010 Marek Hummel - Mib validation, add wldValue +-- 1.01-bis 12.5.2021 ChangeOID to avoid collisions with STE-MIB +-- + +HWg-WLD-MIB DEFINITIONS ::= BEGIN +IMPORTS + OBJECT-TYPE FROM RFC-1212 + Gauge, enterprises FROM RFC1155-SMI + DisplayString, sysName FROM RFC1213-MIB + TRAP-TYPE FROM RFC-1215; + + +-- +-- Type Definitions +-- +PositiveInteger ::= INTEGER (1..2147483647) -- 0x7FFF FFFF + + +SensorState ::= INTEGER { + invalid (0), + normal (1), + alarm (3) + } + +SensorValue ::= INTEGER { + normal (0), + flooded (1), + disconnect (2), + invalid (3) + } + +SensorSN ::= DisplayString (SIZE (0..16)) +SensorName ::= DisplayString (SIZE (0..16)) +SensorID ::= INTEGER + +-- +-- Node Definitions +-- + +hwgroup OBJECT IDENTIFIER ::= { enterprises 21796 } +x390 OBJECT IDENTIFIER ::= { hwgroup 4 } +hwgwld OBJECT IDENTIFIER ::= { x390 5 } + +-- Application Info ------------------------------------------------------------ + +info OBJECT IDENTIFIER ::= { hwgwld 70 } + +infoAddressMAC OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..17)) + ACCESS read-only + STATUS mandatory + DESCRIPTION + "MAC address in text form. + It is here to distinguish devices in trap messages." + ::= { info 1 } + +-- Sensors --------------------------------------------------------------------- + +wldTable OBJECT-TYPE + SYNTAX SEQUENCE OF WldEntry + ACCESS not-accessible + STATUS mandatory + DESCRIPTION + "A list of sensor table entries. The number + of entries corresponds with number of detected sensors." + ::= { hwgwld 4 } + +wldEntry OBJECT-TYPE + SYNTAX WldEntry + ACCESS not-accessible + STATUS mandatory + DESCRIPTION + "An entry containing information applicable to a + particular sensor." + INDEX { wldIndex } + ::= { wldTable 1 } + +WldEntry ::= SEQUENCE { + wldIndex PositiveInteger, + wldName SensorName, + wldState SensorState, + wldSN SensorSN, + wldID SensorID, + wldValue SensorValue +} + +wldIndex OBJECT-TYPE + SYNTAX PositiveInteger + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor index." + ::= { wldEntry 1 } + +wldName OBJECT-TYPE + SYNTAX SensorName + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor name." + ::= { wldEntry 2 } + +wldState OBJECT-TYPE + SYNTAX SensorState + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor state." + ::= { wldEntry 3 } + +wldSN OBJECT-TYPE + SYNTAX SensorSN + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor Serial number." + ::= { wldEntry 4 } + +wldID OBJECT-TYPE + SYNTAX SensorID + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor ID." + ::= { wldEntry 5 } + +wldValue OBJECT-TYPE + SYNTAX SensorValue + ACCESS read-only + STATUS mandatory + DESCRIPTION + "The sensor value." + ::= { wldEntry 6 } + +-- Trap Definitions ------------------------------------------------------------ + +wldStateToAlarm TRAP-TYPE + ENTERPRISE hwgwld + VARIABLES { sysName, infoAddressMAC, wldIndex, wldName, wldState, wldSN, wldID, wldValue } + DESCRIPTION + "Sensor n changed to Alarm state." + ::= 1 + +wldStateToNormal TRAP-TYPE + ENTERPRISE hwgwld + VARIABLES { sysName, infoAddressMAC, wldIndex, wldName, wldState, wldSN, wldID, wldValue } + DESCRIPTION + "Sensor n changed to Normal state." + ::= 2 + +wldPeriodicAlarm TRAP-TYPE + ENTERPRISE hwgwld + VARIABLES { sysName, infoAddressMAC, wldIndex, wldName, wldState, wldSN, wldID, wldValue } + DESCRIPTION + "Sensor n periodic Alarm." + ::= 3 + +END diff --git a/tests/data/hwg-wld_600415.json b/tests/data/hwg-wld_600415.json new file mode 100644 index 0000000000..73566e60ef --- /dev/null +++ b/tests/data/hwg-wld_600415.json @@ -0,0 +1,129 @@ +{ + "os": { + "discovery": { + "devices": [ + { + "sysName": "", + "sysObjectID": ".1.3.6.1.4.1.21796.4.1", + "sysDescr": "HWg-WLD", + "sysContact": "", + "version": null, + "hardware": null, + "features": null, + "os": "hwg-wld", + "type": "environment", + "serial": "27C0A91E02590ADA", + "icon": "hwg.svg", + "location": "" + } + ] + }, + "poller": "matches discovery" + }, + "sensors": { + "discovery": { + "sensors": [ + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.21796.4.5.4.1.3.1", + "sensor_index": "wldState.1", + "sensor_type": "wldState", + "sensor_descr": "\"Cafeteria\" state", + "group": null, + "sensor_divisor": 1, + "sensor_multiplier": 1, + "sensor_current": 3, + "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": "wldState" + }, + { + "sensor_deleted": 0, + "sensor_class": "state", + "poller_type": "snmp", + "sensor_oid": ".1.3.6.1.4.1.21796.4.5.4.1.6.1", + "sensor_index": "wldValue.1", + "sensor_type": "wldValue", + "sensor_descr": "\"Cafeteria\" detailed 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": "wldValue" + } + ], + "state_indexes": [ + { + "state_name": "wldState", + "state_descr": "invalid", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 2 + }, + { + "state_name": "wldState", + "state_descr": "normal", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 0 + }, + { + "state_name": "wldState", + "state_descr": "alarm", + "state_draw_graph": 0, + "state_value": 3, + "state_generic_value": 2 + }, + { + "state_name": "wldValue", + "state_descr": "normal", + "state_draw_graph": 0, + "state_value": 0, + "state_generic_value": 0 + }, + { + "state_name": "wldValue", + "state_descr": "flooded", + "state_draw_graph": 0, + "state_value": 1, + "state_generic_value": 2 + }, + { + "state_name": "wldValue", + "state_descr": "disconnect", + "state_draw_graph": 0, + "state_value": 2, + "state_generic_value": 3 + }, + { + "state_name": "wldValue", + "state_descr": "invalid", + "state_draw_graph": 0, + "state_value": 3, + "state_generic_value": 2 + } + ] + }, + "poller": "matches discovery" + } +} diff --git a/tests/snmpsim/hwg-wld_600415.snmprec b/tests/snmpsim/hwg-wld_600415.snmprec new file mode 100644 index 0000000000..a6b3d4a9e2 --- /dev/null +++ b/tests/snmpsim/hwg-wld_600415.snmprec @@ -0,0 +1,12 @@ +1.3.6.1.2.1.1.1.0|4|HWg-WLD +1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.21796.4.1 +1.3.6.1.2.1.1.3.0|67|253200 +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.4.1.21796.4.5.4.1.1.1|2|1 +1.3.6.1.4.1.21796.4.5.4.1.2.1|4|Cafeteria +1.3.6.1.4.1.21796.4.5.4.1.3.1|2|3 +1.3.6.1.4.1.21796.4.5.4.1.4.1|4|27C0A91E02590ADA +1.3.6.1.4.1.21796.4.5.4.1.5.1|2|215 +1.3.6.1.4.1.21796.4.5.4.1.6.1|2|1