Page 1 of 1

More readable SNMP Trap Alert

Posted: Fri May 03, 2019 12:35 am
by eugenesoo
Hi,

I came across the Nagios XI email alert and find the $serviceoutput$ is quite challenged to derive and understand. Please refer the sample alert below:
Image

Would appreciate if any kind soul can advise the way to break the trap into more human readable like below?
Image

Thank you!

Re: More readable SNMP Trap Alert

Posted: Fri May 03, 2019 2:26 pm
by ssax
It's showing you the exact content of the trap it received, there is no post processing of that trap to get it formatted in the way you'd like, you'd need to do that in the EXEC line of the trap or maybe by using the REGEX line, it really depends on if there are newlines in the trap, they are likely not in there so you will need to add them for them to display:

Code: Select all

REGEX:

[REGEX(    )(    )[i][g][e]]

Optional regular expression to perform a search and replace on the translated FORMAT / EXEC line.  Multiple REGEX (    )(    ) lines are permitted.
See here for more information:

http://snmptt.sourceforge.net/docs/snmp ... CONF-REGEX

So you can either modify the trap definition or figure out a way to parse the values out and format it the way that you want during the sending of the notification (you would need to write your own notification handler for this).

Let us know if you have any questions or if we can clarify anything for you.