SNMP Trap defination with a fixed OID for several services

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

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

Postby tgriep » Wed Jan 09, 2019 2:01 pm

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/nagios-xi-snmp-trap-tutorial-77.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7944
Joined: Thu Oct 30, 2014 9:02 am

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

Postby parisa » Sat Jan 12, 2019 6:02 am

Hi
Thank you for your help , it works now.
parisa
 
Posts: 47
Joined: Tue Sep 25, 2018 3:18 am

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

Postby tgriep » Mon Jan 14, 2019 11:11 am

Thanks for reporting back that it is working now.
Out of curiosity, what was the final change done to get is working?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7944
Joined: Thu Oct 30, 2014 9:02 am

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

Postby parisa » Tue Jan 15, 2019 2:31 am

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
parisa
 
Posts: 47
Joined: Tue Sep 25, 2018 3:18 am

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

Postby tgriep » Tue Jan 15, 2019 11:32 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 7944
Joined: Thu Oct 30, 2014 9:02 am

Previous

Return to Nagios XI

Who is online

Users browsing this forum: No registered users and 13 guests