Nagios SNMP Trap Configuration: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== SNMP Trap Configuration == # Install the following RHEL/CentOS packages ## net-snmp ## net-snmp-libs ## net-snmp-agent-libs ## net-snmp-utils ## net-snmp-perl ## snmptt # E...") |
No edit summary |
||
Line 7: | Line 7: | ||
## net-snmp-perl | ## net-snmp-perl | ||
## snmptt | ## snmptt | ||
# Edit the '''<tt>/etc/sysconfig/snmptrapd</tt>''' | # Edit the '''<tt>/etc/sysconfig/snmptrapd</tt>''' file. | ||
## Set the '''<tt>OPTIONS</tt>'' line to reflect '''<tt>OPTIONS="-Lsd -On"</tt>''' | ## Set the '''<tt>OPTIONS</tt>''' line to reflect '''<tt>OPTIONS="-Lsd -On"</tt>'''. | ||
# Edit the '''<tt>/etc/snmp/snmptrapd.conf</tt>''' file. | |||
## Add or modify the lines in the file with the following information. | |||
### authCommunity log,execute,net public | |||
### disableAuthorization yes | |||
### traphandle default snmptt | |||
# Edit the '''<tt>/etc/snmp/snmptt.ini</tt>''' file. | |||
## Find the '''<tt>[TrapFiles]'''</tt> stanza and modify it to be similar to below. | |||
<pre> | |||
[TrapFiles] | |||
snmptt_conf_files = <<END | |||
/etc/snmp/snmptt.conf | |||
/etc/snmp/snmptt.conf.<new MIB file> | |||
END | |||
</pre> | |||
# Edit your Nagios templates file. | |||
## Add a new service template with the following information. This is a minimal configuration, modify as per environment. | |||
<pre> | |||
define service { | |||
name snmptrap-service | |||
use generic-service ; Inherit default values from the generic-service definition | |||
is_volatile 1 ; Service is volatile | |||
check_period none ; The check is NEVER initiated by the Nagios Server | |||
notification_interval 15 ; Re-notify about service problems every 15 minutes | |||
max_check_attempts 1 ; Check the service up to 2 times in order to determine its final (hard) state | |||
check_command check-host-alive ; This is used to manually "reset" the status of the service | |||
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! | |||
} | |||
</pre> |
Revision as of 16:47, 14 April 2015
SNMP Trap Configuration
- Install the following RHEL/CentOS packages
- net-snmp
- net-snmp-libs
- net-snmp-agent-libs
- net-snmp-utils
- net-snmp-perl
- snmptt
- Edit the /etc/sysconfig/snmptrapd file.
- Set the OPTIONS line to reflect OPTIONS="-Lsd -On".
- Edit the /etc/snmp/snmptrapd.conf file.
- Add or modify the lines in the file with the following information.
- authCommunity log,execute,net public
- disableAuthorization yes
- traphandle default snmptt
- Add or modify the lines in the file with the following information.
- Edit the /etc/snmp/snmptt.ini file.
- Find the [TrapFiles] stanza and modify it to be similar to below.
[TrapFiles] snmptt_conf_files = <<END /etc/snmp/snmptt.conf /etc/snmp/snmptt.conf.<new MIB file> END
- Edit your Nagios templates file.
- Add a new service template with the following information. This is a minimal configuration, modify as per environment.
define service { name snmptrap-service use generic-service ; Inherit default values from the generic-service definition is_volatile 1 ; Service is volatile check_period none ; The check is NEVER initiated by the Nagios Server notification_interval 15 ; Re-notify about service problems every 15 minutes max_check_attempts 1 ; Check the service up to 2 times in order to determine its final (hard) state check_command check-host-alive ; This is used to manually "reset" the status of the service register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! }