Hi Max Thanks for your help! I am now ok to use the snmptrap to send out alert. But it seems the nagios doesn't involk the send_trap script to do the job. I setup same on a vm with nagios and use my laptop with wireshark to monitor incoming snmp traffic. In localhost.cfg, I changed to 1 and 2 for current users to create warning. I can see warning on nagios UI but still nothing to capture on sniffer with port 162. unless I manual to send trap..anything I mssing? I also attached the result that sniffer recieved, and my cfg as below. please advise, Thanks!
define service{ use local-service ; Name of service template to use host_name localhost service_description Current Users event_handler send_trap event_handler_enabled 1 check_command check_local_users!1!2 } commands.cfg # 'send_trap' command definition define command{ command_name send_trap command_line /optnagios/libexec/send_trap 192.168.32.1 public $HOSTNAME$ $SERVICEDESC$ $SERVICESTATEID$ $SERVICEOUTPUT$ } [r...@nagios libexec]# more send_trap #!/bin/sh # 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) # # echo $1 >> /var/tmp/debug echo $2 >> /var/tmp/debug echo $3 >> /var/tmp/debug echo $HOSTNAME$ >> /var/tmp/debug echo $SERVICEDESC$ >> /var/tmp/debug echo $SERVICESTATEID$ >> /var/tmp/debug echo $SERVICEOUTPUT$ >> /var/tmp/debug /usr/bin/snmptrap -v 2c -c $2 $1 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s $3 nSvcDesc s "$ 4" nSvcStateID i $5 nSvcOutput s "$6" #/usr/bin/snmptrap -v 2c -c $2 192.168.32.1 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s "$3" nSvcDesc s "$4" nSvcStateID i $5 nSvcOutput s "$6" [r...@nagios libexec]# [r...@nagios libexec]# /usr/bin/snmptrap -v 2c -c public 192.168.32.1 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s localhost nSvcDesc s "some service desc supposed to come from nagios" nSvcStateID i 0 nSvcOutput s "some service may down testing" [r...@nagios libexec]# tail /var/tmp/debug 192.168.32.1 public localhost nagios.localdomain$ $ $ $ [r...@nagios libexec]# -----Original Message----- From: max.schub...@gmail.com [mailto:max.schub...@gmail.com] On Behalf Of Max Sent: Wednesday, August 26, 2009 12:31 PM To: Scott Xiao Cc: nagios-users@lists.sourceforge.net Subject: Re: [Nagios-users] any solution which will allow me to forward Nagios alerts to Netcool? Scott, On Wed, Aug 26, 2009 at 12:02 AM, Scott Xiao<scott_x...@nec.com.sg> wrote: > > Hi friends > Is there any solution which will allow me to forward > Nagios alerts to Netcool? I read looperng but not many details on how to > forward the alert to netcool, any advice (url /docs)? > Thanks > Scott Does Netcool have a trap receiver? If so, you can forward alerts with SNMP. We forward Nagios notifications to Spectrum by sending them as traps using the NAGIOS-NOTIFY-MIB service and host events .. works quite well. - max
nagiosforwarding1.pcap
Description: nagiosforwarding1.pcap
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Nagios-users mailing list Nagios-users@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