Page 3 of 3

Re: SNMP Trap defination with a fixed OID for several servic

Posted: Wed Jan 09, 2019 2:01 pm
by tgriep
You need to adjust the Match statements for what the remote server is sending.

Do this, when a Trap is received and the snmptt daemon does not have an OID for it, it puts in in the /var/log/snmp/snmpttunknown.log file.
What you could do is to comment out the entry in the snmptt.conf file and restart the daemon.
Go to the device that is sending the traps and generate the traps for what you want to match on.
Look in the unknown log file for what is received and adjust the match statements in the snmptt.conf file.

This article has more details on how to do that.
https://support.nagios.com/kb/article/n ... al-77.html

Re: SNMP Trap defination with a fixed OID for several servic

Posted: Sat Jan 12, 2019 6:02 am
by parisa
Hi
Thank you for your help , it works now.

Re: SNMP Trap defination with a fixed OID for several servic

Posted: Mon Jan 14, 2019 11:11 am
by tgriep
Thanks for reporting back that it is working now.
Out of curiosity, what was the final change done to get is working?

Re: SNMP Trap defination with a fixed OID for several servic

Posted: Tue Jan 15, 2019 2:31 am
by parisa
I couldn't use NXTI, because when I defined some Match statements, it didn't work. Even though I deleted NXTI related configuration and defined Mibs and traps by snmptt, traps in snmptt has been shown as comment, and
so I deleted defined traps in NXTI and MIBs, then uploaded MIBs again by SNMPTT, , because of I used to receive traps in log file as Inappropriate form,so did some change in snmptt.ini :

Code: Select all

translate_value_oids = 1
translate_trap_oid_format = 1
translate_varname_oid_format = 1
also deleted "/etc/snmp/snmptt.conf.nxti" line from snmptt_conf_files in snmptt.ini.
after that defined 2 traps for every service in snmptt.conf as below:

Code: Select all

EVENT Alarm_1 .1.x.x.x.x.x.x.x.x.1.7.1.0.1 "TRS_Alarms" Critical
FORMAT Received trap "$N" with variables "$+*"
EXEC /usr/local/bin/snmptraphandling.py "$1" "Alarm_1" "$s" "$@" "" "Received trap from Host: $1 with Alarm: $16 at Time: $x $X with severity: $7 Category: $10 LN: $13 Location: $3 and Desc: $6"
MATCH $10: (Fault)
MATCH $16: (Alarm_1)
MATCH MODE=and
SDESC
The Trap is related to Alarm_1
EDESC
##
EVENT Alarm_1 .1.x.x.x.x.x.x.x.x.1.7.1.0.1 "TRS_Alarms" Critical
FORMAT Received trap "$N" with variables "$+*"
EXEC /usr/local/bin/snmptraphandling.py "$1" "Alarm_1" "$s" "$@" "" "Received trap from Host: $1 with Alarm: $16 at Time: $x $X with severity: $7 Category: $10 LN: $13 Location: $3 and Desc: $6"
MATCH $10: (Recovery)
MATCH $16: (Alarm_1)
MATCH MODE=and
SDESC
The Trap is related to Alarm_1, when the alarm has been cleared
EDESC
Now it works correctly.

Thanks

Re: SNMP Trap defination with a fixed OID for several servic

Posted: Tue Jan 15, 2019 11:32 am
by tgriep
Thanks for sharing what you did to get this working.
There were some bugs in the SNMP Trap Interface GUI and some enhancements done so hopefully when the next release happens, they will be resolved.