[Solved] Please add support for the HWG STE2 Flood sensor 1W-UNI

Hello!

I rencently added a new Flood sensor to my HWG STE2 unit → 1w-uni
https://www.hw-group.com/sensor/flood-detector-1w-uni-3m

I can see the sensor and value when doing snmpwalk, i can see it when i run a discovery, but i cant monitor on the value beacuse it wont go in the database.
I beleve the Yaml-file needs some modification.

The OID-string for the flood sensor .1.3.6.1.4.1.21796.4.9.3.1.5.1
The value is 1 for flood and 0 when not (Integer)

Validate:

===========================================
Component | Version
--------- | -------
LibreNMS  | 24.10.1-16-g1f50c51ed (2024-11-12T13:43:24+01:00)
DB Schema | 2024_11_07_110342_custommap_edge_add_text_align (305)
PHP       | 8.1.2-1ubuntu2.19
Python    | 3.10.12
Database  | MariaDB 10.6.18-MariaDB-0ubuntu0.22.04.1
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================

[OK]    Composer Version: 2.8.2
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQL and PHP time match
[OK]    Active pollers found
[OK]    Dispatcher Service not detected
[OK]    Locks are functional
[OK]    Python poller wrapper is polling
[OK]    Redis is unavailable
[OK]    rrd_dir is writable
[OK]    rrdtool version ok

/opt/librenms/includes/definitions/discovery/hwg-ste2.yaml

mib: STE2-MIB
modules:
    os:
        sysDescr_regex: '/(?<hardware>.*),\s+fw:(?<version>.*)?/'
    sensors:
        temperature:
            data:
                -
                    oid: sensTable
                    value: sensValue
                    num_oid: '.1.3.6.1.4.1.21796.4.9.3.1.5.{{ $index }}'
                    descr: sensName
                    index: '{{ $index }}'
                    divisor: 10
                    skip_values:
                        -
                            oid: sensUnit
                            op: '!='
                            value: 1
        humidity:
            data:
                -
                    oid: sensTable
                    value: sensValue
                    num_oid: '.1.3.6.1.4.1.21796.4.9.3.1.5.{{ $index }}'
                    descr: sensName
                    index: '{{ $index }}'
                    divisor: 10
                    skip_values:
                        -
                            oid: sensUnit
                            op: '!='
                            value: 4
        state:
            data:
                -
                    oid: inpTable
                    value: inpAlarmState
                    num_oid: '.1.3.6.1.4.1.21796.4.9.1.1.4.{{ $index }}'
                    descr: 'Alarm: {{ $inpName }}'
                    index: 'inpAlarmState.{{ $index }}'
                    state_name: inpAlarmState
                    states:
                        - { descr: normal, graph: 0, value: 0, generic: 0 }
                        - { descr: alarm, graph: 0, value: 1, generic: 2 }

STE2 SNMP OID description:

-------------------------------------------------------------------------

System Values:
----------------------------------------------------
.1.3.6.1.2.1.1.1.0             System Description   (string)
.1.3.6.1.2.1.1.2.0             System ObjectID      (objid)
.1.3.6.1.2.1.1.3.0             System UpTime        (timeticks)
.1.3.6.1.2.1.1.4.0             System Contact       (string)
.1.3.6.1.2.1.1.5.0             System Name          (string)
.1.3.6.1.2.1.1.6.0             System Location      (string)
.1.3.6.1.2.1.1.7.0             System Services      (integer)
.1.3.6.1.4.1.21796.4.9.70.1.0  System MAC address   (string)

Input Dry Contacts
----------------------------------------------------
.1.3.6.1.4.1.21796.4.9.1.1.1.n Input Index          (integer,  NUM  (1..x))
.1.3.6.1.4.1.21796.4.9.1.1.2.n Input Value          (integer,  0=Open, 1=Close)
.1.3.6.1.4.1.21796.4.9.1.1.3.n Input Name           (string,   SIZE (0..16))
.1.3.6.1.4.1.21796.4.9.1.1.4.n Input Alarm State    (integer,  0=Normal, 1=Alarm)

Sensors Values, (n = 1..x)
----------------------------------------------------
.1.3.6.1.4.1.21796.4.9.3.1.1.n Sensor Index         (integer,  NUM  (1..x))
.1.3.6.1.4.1.21796.4.9.3.1.2.n Sensor Name          (string,   SIZE (0..16))
.1.3.6.1.4.1.21796.4.9.3.1.3.n Sensor State         (integer,  0=Invalid, 1=Normal, 4=AlarmLo, 5=AlarmHi)
.1.3.6.1.4.1.21796.4.9.3.1.4.n Sensor String Value  (string,   SIZE (0..10))
.1.3.6.1.4.1.21796.4.9.3.1.5.n Sensor Value         (integer,  current value *10)
.1.3.6.1.4.1.21796.4.9.3.1.6.n Sensor SN            (string,   SIZE (0..16))
.1.3.6.1.4.1.21796.4.9.3.1.7.n Sensor Unit          (integer,  0=unknown, 1=C, 2=F, 3=K, 4=%)
.1.3.6.1.4.1.21796.4.9.3.1.8.n Sensor ID            (integer,  NUM	(0..x))

We need the output from an snmpwalk, please see our FAQs on how to do that.

My bad, here it comes:

iso.3.6.1.2.1.1.1.0 = STRING: "STE2 r2, fw:1.5.9_2478"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.21796.4.9
iso.3.6.1.2.1.1.3.0 = Timeticks: (93019882) 10 days, 18:23:18.82
iso.3.6.1.2.1.1.4.0 = STRING: "OT-Avd"
iso.3.6.1.2.1.1.5.0 = STRING: "hohatemp01"
iso.3.6.1.2.1.1.6.0 = STRING: "Datorrum 2 IT"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.2.1.11.1.0 = Counter32: 106618
iso.3.6.1.2.1.11.2.0 = Counter32: 106618
iso.3.6.1.2.1.11.3.0 = Counter32: 0
iso.3.6.1.2.1.11.4.0 = Counter32: 0
iso.3.6.1.2.1.11.5.0 = Counter32: 0
iso.3.6.1.2.1.11.6.0 = Counter32: 0
iso.3.6.1.2.1.11.8.0 = Counter32: 0
iso.3.6.1.2.1.11.9.0 = Counter32: 1
iso.3.6.1.2.1.11.10.0 = Counter32: 0
iso.3.6.1.2.1.11.11.0 = Counter32: 0
iso.3.6.1.2.1.11.12.0 = Counter32: 0
iso.3.6.1.2.1.11.13.0 = Counter32: 357635
iso.3.6.1.2.1.11.14.0 = Counter32: 0
iso.3.6.1.2.1.11.15.0 = Counter32: 78889
iso.3.6.1.2.1.11.16.0 = Counter32: 27743
iso.3.6.1.2.1.11.17.0 = Counter32: 0
iso.3.6.1.2.1.11.18.0 = Counter32: 0
iso.3.6.1.2.1.11.19.0 = Counter32: 0
iso.3.6.1.2.1.11.20.0 = Counter32: 0
iso.3.6.1.2.1.11.21.0 = Counter32: 0
iso.3.6.1.2.1.11.22.0 = Counter32: 0
iso.3.6.1.2.1.11.24.0 = Counter32: 0
iso.3.6.1.2.1.11.25.0 = Counter32: 0
iso.3.6.1.2.1.11.26.0 = Counter32: 0
iso.3.6.1.2.1.11.27.0 = Counter32: 0
iso.3.6.1.2.1.11.28.0 = Counter32: 106642
iso.3.6.1.2.1.11.29.0 = Counter32: 0
iso.3.6.1.2.1.11.30.0 = INTEGER: 1
iso.3.6.1.2.1.11.31.0 = INTEGER: 0
iso.3.6.1.2.1.11.32.0 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.1.1.1.2 = INTEGER: 2
iso.3.6.1.4.1.21796.4.9.1.1.2.1 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.2.2 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.3.1 = STRING: "Input 1"
iso.3.6.1.4.1.21796.4.9.1.1.3.2 = STRING: "Input 2"
iso.3.6.1.4.1.21796.4.9.1.1.4.1 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.1.1.4.2 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.3.1.1.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.1.2 = INTEGER: 2
iso.3.6.1.4.1.21796.4.9.3.1.2.1 = STRING: "Flood"
iso.3.6.1.4.1.21796.4.9.3.1.2.2 = STRING: "Datorrum 2"
iso.3.6.1.4.1.21796.4.9.3.1.3.1 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.3.2 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.4.1 = STRING: "0"
iso.3.6.1.4.1.21796.4.9.3.1.4.2 = STRING: "20.8"
iso.3.6.1.4.1.21796.4.9.3.1.5.1 = INTEGER: 0
iso.3.6.1.4.1.21796.4.9.3.1.5.2 = INTEGER: 207
iso.3.6.1.4.1.21796.4.9.3.1.6.1 = STRING: "260C46170E0C09F2"
iso.3.6.1.4.1.21796.4.9.3.1.6.2 = STRING: "282AE2E40C0000C2"
iso.3.6.1.4.1.21796.4.9.3.1.7.1 = INTEGER: 5
iso.3.6.1.4.1.21796.4.9.3.1.7.2 = INTEGER: 1
iso.3.6.1.4.1.21796.4.9.3.1.8.1 = INTEGER: 17932
iso.3.6.1.4.1.21796.4.9.3.1.8.2 = INTEGER: 57898
iso.3.6.1.4.1.21796.4.9.70.1.0 = STRING: "00:0A:59:05:AF:F5"

``
diff --git a/includes/definitions/discovery/hwg-ste2.yaml b/includes/definitions/discovery/hwg-ste2.yaml
--- a/includes/definitions/discovery/hwg-ste2.yaml	(revision 4306d33f3d0cf8eae0a251b746e08f49c554e30a)
+++ b/includes/definitions/discovery/hwg-ste2.yaml	(date 1732019743359)
@@ -43,3 +43,20 @@
                     states:
                         - { descr: normal, graph: 0, value: 0, generic: 0 }
                         - { descr: alarm, graph: 0, value: 1, generic: 2 }
+                -
+                    oid: sensTable
+                    value: sensState
+                    num_oid: '.1.3.6.1.4.1.21796.4.9.3.1.3.{{ $index }}'
+                    descr: sensName
+                    index: 'sensState.{{ $index }}'
+                    state_name: sensState
+                    states:
+                        - { descr: unknown, graph: 0, value: 0, generic: 3 }
+                        - { descr: normal, graph: 0, value: 1, generic: 0 }
+                        - { descr: alarm, graph: 0, value: 4, generic: 2 }
+                        - { descr: alarm, graph: 0, value: 5, generic: 2 }
+                    skip_values:
+                        -
+                            oid: sensUnit
+                            op: '!='
+                            value: 5

1 Like

Thank You @laf worked perfect! Much appreciated!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.