Dynamically capture data from SNMP traps?

All,

Is there a way to dynamically capture information in the snmptrap.log and send that data through a script alert as a text string?

Example:

var5=99 var6=CPFA095 received by UTLWRKTQ01 at 12300. (C D I R) var7=UTLWRKOQ01 var8=SJHPROD var9=016418 var10=QCLXERR

I will be receiving these traps on a consistent basis.

The requirement is to create a ticket, via script, for every message where var5=99.

Can we then take any message that is after var6= and turn it into a text string somehow?

So then what I could do is variabilize that text string, send it through a script to an alert?

Because if we can do that, I can create a dynamic solution for us; otherwise we're looking at creating an SNMP trap for every single possible message that can come through and that is likely at least 1000 of them.

Appreciate your help!

Tags:

  • It should be possible to do what you want. Here is an idea how to achieve it:

    1. Setup SNMP Trap monitor

    2. Use regular expression in the "Content match" field of the monitor. Something like /var5=99 (.*)/

    3. Setup a script alert for the monitor and pass to the script a parameter referencing the captured trap part (everything after "var5=99 ") as <value>

    If you never worked with script alerts in SiteScope before, I would highly recommend you first reading "Write Scripts for Script Alerts" chapter in the Using SiteScope guide.