Sending SNMP traps to a management host

narendran.neelamegam at wipro.com narendran.neelamegam at wipro.com
Mon Aug 21 10:50:39 CEST 2006


Hi,

1. I have to configure Nagios to send alerts to a management host.

These two are connected via VPN. What will be best method to sent nagios
alerts to the management host.

2. I thought of sending Nagios alerts as SNMP traps to management host.

I have followed the procedure listed below and was not successful.
Please suggest me a procedure to configure SNMP traps to management
host. Thanks.

I have followed the procedure as listed below. Please let me how I can
correclty configure SNMP traps to be sent from Nagios to management host


Configured Event Handling in Services.cfg

define service{
        use                             generic-service         ; Name
of service template to use

        host_name                       test-server
        service_description             SVCS-SERVICES-ITO
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              1
        normal_check_interval           2
        retry_check_interval            1
        contact_groups                  windows-admins
        notification_interval           90
        notification_period             24x7
        notification_options            c,r
        event_handler                   send_trap
        event_handler_enabled            1
        check_command
check_nt_service!'AdaptecStorageManagerAgent',Browser,Dfs,Dnscache,Event
log,EventSystem,lanmanserver,lanmanworkstation,LmHosts,Messenger,MSDTC,N
etlogon,PlugPlay,ProtectedStorage,RasMan,RemoteRegistry,RpcSs,SamSs,Sche
dule,seclogon,SENS,TermService,W32Time,WinMgmt,wuauserv,NSClient++,Tomca
t5,'DNS',TermService,AeLookupSvc,AppMgmt,BITS,CertSVc,EventSystem,DcomLa
unch,ERSvc,Eventlog,NtFrs,HTTPFilter,IISADMIN,RpcSs,SamSs,SENS
        }

Configured Trap handling command in misccommands.cfg

# SNMP TRAP EVENT HADNLER

define command{
command_name send_trap
command_line /usr/local/nagios/libexec/send_trap 192.168.16.11 public
$HOSTNAME$ $SERVICEDESC$ $SERVICESTATEID$ $SERVICEOUTPUT$
}

Send_Trap script

# Arguments:
# $1 = Management Station
# $2 = Community String
# $3 = host_name
# $4 = service_description (Description of the service)
# $5 = return_code (An integer that determines the state
# of the service check, 0=OK, 1=WARNING, 2=CRITICAL,
# 3=UNKNOWN).
# $6 = plugin_output (A text string that should be used
# as the plugin output for the service check)
#
#
/usr/bin/snmptrap -v 2c -c $2 $1 '' NAGIOS-NOTIFY-MIB::nSvcEvent
nSvcHostname s "$3" nSvcDesc s "$4" nSvcStateID i $5 nSvcOutput s "$6"

When the service fails the event handler script is executing...

[1156147494] SERVICE NOTIFICATION:
nagios;test-server;SVCS-SERVICES-ITO;OK;notify-by-epager; OK: All
services are running.
[1156147494] SERVICE NOTIFICATION:
nagios;test-server;SVCS-SERVICES-ITO;OK;notify-by-email; OK: All
services are running.
[1156147494] SERVICE EVENT HANDLER:
test-server;SVCS-SERVICES-ITO;OK;HARD;1;send_trap

I'm running the snmp trapd as

/usr/sbin/snmptrapd -m ALL -M /usr/share/snmp/mibs -c
/etc/snmp/snmptrad.conf -u /var/run/snmptrapd.pid

However the management host does not receive any alert ?

Thanks and Regards,

Narendran Neelamegam


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list