Re: SNMP Traps
Posted: Fri Jan 27, 2017 2:08 pm
Please read and follow this guide (including running the shell script), I know it's for XI but it should install and setup traps properly, the information is very relavent:
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
Then blank out your /etc/snmp/snmptt.conf file and then run the addmib command against your MIBs:
Then restart snmptt (you need to do this after every snmptt.conf change):
Let us know the results after testing and include all logs from /var/log/snmptt after submitting multiple traps. Also, please include your /etc/snmp/snmptt.conf file after you've done all of the above.
--
I'll include this additional information here to help you out:
This is the general flow of how SNMP traps work:
Device -> Nagios Server -> snmptrapd -> snmptt -> Nagios Service
Here's how it works in greater detail:
1. The device sends a SNMP trap with say an OID of .1.3.6.1.6.3.1.1.5.1 to the Nagios XI server.
2. The snmptrapd service receives the trap and then runs the default handler for traps (in this case SNMPTT)
- Taken from /etc/snmp/snmptrapd.conf
3. SNMPTT reads the trap and does some processing on it based on it's configuration (translate IP of sender into DNS name, strip domain, all configurable in /etc/snmp/snmptt.ini).
4. SNMPTT doesn't know anything about the traps in your MIB files, the MIB files on the system are just used for translation from .1.3.6.1.6.3.1.1.5.1 into coldStart. You need to process the MIB file that contains your traps to get them into the /etc/snmp/snmptt.conf file which SNMPTT reads to match against to see if it should do anything with it (.1.3.6.1.6.3.1.1.5.1).
5. Since you've run addmib on the MIB file containing your traps (in this case /usr/share/snmp/mibs/SNMPv2-MIB.txt) it processes the trap and puts it into a format SNMPTT understands and changes the EXEC line (see below) to execute the snmptraphandling.py script (that's what puts it into Nagios).
So SNMPTT says "Hey, I received a trap with OID .1.3.6.1.6.3.1.1.5.1, do I know anything about it? Let me check my /etc/snmp/snmptt.conf file. Oh, I see it matches the coldStart event (from above), I will run this EXEC line now (which happens to put it into Nagios)."
You can read more about SNMPTT and what those lines mean (and how you can change them if you want) here:
http://snmptt.sourceforge.net/docs/snmptt.shtml
Please see here for advanced reading:
https://support.nagios.com/kb/article.php?id=232
https://support.nagios.com/kb/article.php?id=559
https://support.nagios.com/kb/article.php?id=77
https://support.nagios.com/kb/article.php?id=493
https://support.nagios.com/kb/article.php?id=558
Thank you
https://assets.nagios.com/downloads/nag ... ios_XI.pdf
Then blank out your /etc/snmp/snmptt.conf file and then run the addmib command against your MIBs:
Code: Select all
addmib /usr/share/snmp/mibs/YOURMIBFILE
addmib /usr/share/snmp/mibs/YOUROTHERMIBFILECode: Select all
service snmptt restart--
I'll include this additional information here to help you out:
This is the general flow of how SNMP traps work:
Device -> Nagios Server -> snmptrapd -> snmptt -> Nagios Service
Here's how it works in greater detail:
1. The device sends a SNMP trap with say an OID of .1.3.6.1.6.3.1.1.5.1 to the Nagios XI server.
2. The snmptrapd service receives the trap and then runs the default handler for traps (in this case SNMPTT)
- Taken from /etc/snmp/snmptrapd.conf
Code: Select all
traphandle default /usr/sbin/snmptthandler4. SNMPTT doesn't know anything about the traps in your MIB files, the MIB files on the system are just used for translation from .1.3.6.1.6.3.1.1.5.1 into coldStart. You need to process the MIB file that contains your traps to get them into the /etc/snmp/snmptt.conf file which SNMPTT reads to match against to see if it should do anything with it (.1.3.6.1.6.3.1.1.5.1).
5. Since you've run addmib on the MIB file containing your traps (in this case /usr/share/snmp/mibs/SNMPv2-MIB.txt) it processes the trap and puts it into a format SNMPTT understands and changes the EXEC line (see below) to execute the snmptraphandling.py script (that's what puts it into Nagios).
Code: Select all
EVENT coldStart .1.3.6.1.6.3.1.1.5.1 "Status Events" Normal
FORMAT A coldStart trap signifies that the SNMP entity, $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A coldStart trap signifies that the SNMP entity, $*"
SDESC
A coldStart trap signifies that the SNMP entity,
supporting a notification originator application, is
reinitializing itself and that its configuration may
have been altered.
Variables:
EDESCYou can read more about SNMPTT and what those lines mean (and how you can change them if you want) here:
http://snmptt.sourceforge.net/docs/snmptt.shtml
Please see here for advanced reading:
https://support.nagios.com/kb/article.php?id=232
https://support.nagios.com/kb/article.php?id=559
https://support.nagios.com/kb/article.php?id=77
https://support.nagios.com/kb/article.php?id=493
https://support.nagios.com/kb/article.php?id=558
Thank you