Updated regex for HWG STE2 r2 to better detect hardware and software version (#15573)

* fix regex for hardware and version
* updated test data
* Update hwg-ste2.snmprec
* Create hwg-ste2.json

---------

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
Lucas Gasenzer 2023-12-03 21:05:51 +01:00 committed by GitHub
parent 6dfb9c41d3
commit be1eefc096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 110 additions and 1 deletions

View File

@ -1,7 +1,7 @@
mib: STE2-MIB
modules:
os:
sysDescr_regex: '/(?<hardware>.+?)( (?<version>[\d.]+))?/'
sysDescr_regex: '/(?<hardware>.*),\s+fw:(?<version>.*)?/'
sensors:
temperature:
data:

96
tests/data/hwg-ste2.json Normal file
View File

@ -0,0 +1,96 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": null,
"sysObjectID": ".1.3.6.1.4.1.21796.4.9",
"sysDescr": "STE2 r2, fw:1.5.5_2394",
"sysContact": "<private>",
"version": "1.5.5_2394",
"hardware": "STE2 r2",
"features": null,
"location": "<private>",
"os": "hwg-ste2",
"type": "environment",
"serial": null,
"icon": "hwg.svg"
}
]
},
"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.9.1.1.4.1",
"sensor_index": "inpAlarmState.1",
"sensor_type": "inpAlarmState",
"sensor_descr": "Alarm: Input 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,
"rrd_type": "GAUGE",
"state_name": "inpAlarmState"
},
{
"sensor_deleted": 0,
"sensor_class": "state",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.21796.4.9.1.1.4.2",
"sensor_index": "inpAlarmState.2",
"sensor_type": "inpAlarmState",
"sensor_descr": "Alarm: Input 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,
"rrd_type": "GAUGE",
"state_name": "inpAlarmState"
}
],
"state_indexes": [
{
"state_name": "inpAlarmState",
"state_descr": "normal",
"state_draw_graph": 0,
"state_value": 0,
"state_generic_value": 0
},
{
"state_name": "inpAlarmState",
"state_descr": "alarm",
"state_draw_graph": 0,
"state_value": 1,
"state_generic_value": 2
}
]
},
"poller": "matches discovery"
}
}

View File

@ -1 +1,14 @@
1.3.6.1.2.1.1.1.0|4|STE2 r2, fw:1.5.5_2394
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.21796.4.9
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.4.1.21796.4.9.1.1.1.1|2|1
1.3.6.1.4.1.21796.4.9.1.1.1.2|2|2
1.3.6.1.4.1.21796.4.9.1.1.2.1|2|0
1.3.6.1.4.1.21796.4.9.1.1.2.2|2|0
1.3.6.1.4.1.21796.4.9.1.1.3.1|4|Input 1
1.3.6.1.4.1.21796.4.9.1.1.3.2|4|Input 2
1.3.6.1.4.1.21796.4.9.1.1.4.1|2|0
1.3.6.1.4.1.21796.4.9.1.1.4.2|2|0
1.3.6.1.4.1.21796.4.9.3.1.5.1|2|0
1.3.6.1.4.1.21796.4.9.3.1.5.2|2|203