Nagios SNMP Trap Configuration: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
== SNMP Trap Configuration == | == SNMP Trap Configuration == | ||
# Install the following RHEL/CentOS packages | # Install the following RHEL/CentOS packages. | ||
## net-snmp | ## '''<tt>net-snmp</tt>''' | ||
## net-snmp-libs | ## '''<tt>net-snmp-libs</tt>''' | ||
## net-snmp-agent-libs | ## '''<tt>net-snmp-agent-libs</tt>''' | ||
## net-snmp-utils | ## '''<tt>net-snmp-utils</tt>''' | ||
## net-snmp-perl | ## '''<tt>net-snmp-perl</tt>''' | ||
## snmptt | ## '''<tt>snmptt</tt>''' | ||
# Edit the '''<tt>/etc/sysconfig/snmptrapd</tt>''' file. | # 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. | # Edit the '''<tt>/etc/snmp/snmptrapd.conf</tt>''' file. | ||
## Add or modify the lines in the file with the following information. | ## Add or modify the lines in the file with the following information. | ||
<pre> | |||
authCommunity log,execute,net public | |||
disableAuthorization yes | |||
traphandle default snmptt | |||
</pre> | |||
# Edit the '''<tt>/etc/snmp/snmptt.ini</tt>''' file. | # Edit the '''<tt>/etc/snmp/snmptt.ini</tt>''' file. | ||
## Find the '''<tt>[TrapFiles]'''</tt> stanza and modify it to be similar to below. | ## Find the '''<tt>[TrapFiles]'''</tt> stanza and modify it to be similar to below. | ||
Line 23: | Line 25: | ||
END | END | ||
</pre> | </pre> | ||
# Copy the '''<tt>nagios-<version>/contrib/eventhandlers'''</tt> directory to the '''<tt>nagios'''</tt> install directory under '''<tt>libexec'''</tt>. | |||
# Edit your Nagios templates file. | # Edit your Nagios templates file. | ||
## Add a new service template with the following information. This is a minimal configuration, modify as per environment. | ## Add a new service template with the following information. This is a minimal configuration, modify as per environment. |
Latest revision as of 16:54, 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
- 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
- Copy the nagios-<version>/contrib/eventhandlers directory to the nagios install directory under libexec.
- 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! }