Ad Widget

Collapse

SNMP Regex and preprocessing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DrGreenBean
    Junior Member
    • Aug 2019
    • 2

    #1

    SNMP Regex and preprocessing

    Hi
    I have struggled to get the temperature from a SNMP sensor to work in Zabbix, if I test the prepossessing steps it shows that it works but I get the following error in Zabbix

    "cannot perform regular expression cannot perform regular expression R.*) match for value of type "string" pattern does not match match for value of type "string" pattern does not match

    Here is what I get from the device, I only need the temperature as 15 degrees

    [root@ovpnsrv ~]# snmpget -v 1 -c public 10.0.7.86 .1.3.6.1.4.1.41542.1.10.2.1.1.9.2
    MONNIT-EGW-MIB:ata1.2 = INTEGER: 156

    I used this regex R.*) with \1 and have also tried ^[0-9][0-9][0-9]$ the test returns 156 which is correct
    I also use a custom multiplier 0.1, I have tried Numeric unsigned and float to try and make it work

    Is my aprouch correct using regex or what is the best correct way?

    In the end I want to be able to log all of the following against the sensor, but will set up a different item for each query

    MONNIT-EGW-MIB::Serial.2 = Gauge32: 370415
    MONNIT-EGW-MIB::Voltage.2 = INTEGER: 291
    MONNIT-EGW-MIB::Type.2 = INTEGER: 2
    MONNIT-EGW-MIB::Age.2 = INTEGER: 2
    MONNIT-EGW-MIB::Active.2 = INTEGER: 1
    MONNIT-EGW-MIB::Alarming.2 = INTEGER: 0
    MONNIT-EGW-MIB::RFSignal.2 = INTEGER: 100
    MONNIT-EGW-MIB:ata1.2 = INTEGER: 191
  • DrGreenBean
    Junior Member
    • Aug 2019
    • 2

    #2
    I managed to solve it with (\d\d\d$)

    Comment

    • AnthonyS_CP
      Junior Member
      • Oct 2019
      • 4

      #3
      DrGreenBean,

      I know you stated that you resolved the temp alteration. However, I am curious if you setup anything within your query to validate the unit types, (11 = 900Mhz Base, 2 = Temperature Sensor, 4 = Water Sensor, 101 = Motion Sensor, 43 = Humidity Sensor). Those are what i have currently for these types of sensors and know they have additional. I just do not have access to them. Currently I'm working on the auto population of each under there own sensor type and serial. This will help with triggers.

      Have you work on any of the trap notifications of each unit?

      Comment

      Working...