HWG WaterLeak sensor support (#12865)

* mib for WaterLeakDetectore

Add support for WaterLeak detection

rename OS

rename OS

rename OS

remove unnecessary module restrictions

space

* disable only some modules
This commit is contained in:
PipoCanaja 2021-06-09 09:56:07 +02:00 committed by GitHub
parent 1066ee404a
commit 31ac00f88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 362 additions and 7 deletions

View File

@ -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 }

View File

@ -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 }

View File

@ -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'

View File

@ -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'

162
mibs/hwg/HWg-WLD-MIB Normal file
View File

@ -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

View File

@ -0,0 +1,129 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.21796.4.1",
"sysDescr": "HWg-WLD",
"sysContact": "<private>",
"version": null,
"hardware": null,
"features": null,
"os": "hwg-wld",
"type": "environment",
"serial": "27C0A91E02590ADA",
"icon": "hwg.svg",
"location": "<private>"
}
]
},
"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"
}
}

View File

@ -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|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
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