Ad Widget

Collapse

SNMP trap parsing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Joep
    Junior Member
    • Aug 2021
    • 1

    #1

    SNMP trap parsing

    Hi!

    I have some issues parsing SNMP traps.

    My SNMP trap looks like:

    Code:
    2021-08-17 11:29:28
    11:29:26 2021/08/17 PDU INFO:
    messageid 0
    errorstatus 0
    receivedfrom UDP: [172.25.6.196]:57319->[172.25.1.6]:162
    transactionid 160
    requestid 1
    version 1
    notificationtype TRAP
    community public
    errorindex 0
    VARBINDS:
    iso.3.6.1.2.1.1.3.0 type=67 value=Timeticks: (63245865) 7 days, 7:40:58.65
    iso.3.6.1.6.3.1.1.4.1.0 type=6 value=OID: iso.3.6.1.4.1.35833.6.254.0.1
    iso.3.6.1.4.1.35833.6.2.8.1.0 type=4 value=STRING: "MER-Stiltedetector-01"
    iso.3.6.1.4.1.35833.6.2.8.1.0 type=4 value="INTEGER: "2"
    iso.3.6.1.4.1.35833.6.2.7.3.5.0 type=4 value="INTEGER: "128"
    I created an item which gets the message as a TEXT:

    Code:
    snmptrap["iso.3.6.1.4.1.35833.6.254.0.1"]
    After that I have 1 trigger which fires when message contains trapper id:

    Code:
    DEVA alert: {{ITEM.VALUE}.regsub("iso.3.6.1.4.1.35833.6.2.8.1.0\stype=4\svalue=STRING:\s(.*)", Problem ID: \1)}
    with expression
    Code:
    find(/Template Deva DB8008/snmptrap["iso.3.6.1.4.1.35833.6.254.0.1"])<>0
    I would like to know if it's possible to:
    - map all three SNMP lines to values
    - use these values in my triggernames
    - use value mapping for the integer values (=1 => Main / =2 => Backup) so my trigger has readable text instead of integers

    Hope someone can help me out here!
    Joep
Working...