====== Monitoring with SNMP traps ====== Required package [[http://www.snmptt.org/|SNMPTT]] 1. Install the snmptt program on the nagios master server. 2. Enable snmptrapd. The snmptrapd.conf contains this line: traphandle default /usr/sbin/snmptt It makes all trap go to snmptt for processing. 3. config snmptt by editing the /etc/snmp/snmptt.ini file. 4. Define what actions to take (what program to run) in /etc/snmp/snmptt.conf. For details, please look at sample config and documentation. In short the snmptt.conf file is created by using the snmpttconvertmib program. After the conf is created, we edit it to make it suitable for nagios; only the EVENT and EXEC is important for our config method. Because the hostname in nagios config is not FQDN, so we need to hardcode the hostname to ip address mapping in ''/etc/hosts'', like this: 1.2.3.4 host1 5.6.7.8 host2 ===== Enable SNMP trap for Windows ===== To make Windows to send snmp trap: go to services in control panel, open the snmp service, open the traps tab, enter the community and trap destinations. The community can be anything, eg. 'public', the trap destinations should be the nagios master server. ===== Enable SNMP trap for Linux ===== To make linux to send snmp trap, add these lines to ''/etc/snmp/snmpd.conf'': # where to send v2 traps: trap2sink nagios.example.com public # send traps on authentication failures authtrapenable 1 ===== Define service for traps ===== ** Tip ** - __**One**__ service is defined for each Nagios host that is to receive traps from SNMPTT. The benefits of using only one service entry is that it is makes it easier to set up Nagios. Trying to define every possible trap for every host you have is **not recommended**. Source: http://www.snmptt.org/docs/snmptt.shtml Define the service as volatile. See [[monitoring_volatile_service|Monitoring volatile service]].