nSvcEvent and nSvcNotify traps

Meyer Jerome Jerome.Meyer at baldata.ch
Wed Jun 3 16:26:46 CEST 2009


As someone an Idea?

 

When an event occurs, Nagios is sending the variable $NOTIFICATIONTYPE
within Email :

 

===email========================================

TEST***** Nagios *****

Notification Type: PROBLEM

Service: Ntp

Host: test1

Address: server_test

State: CRITICAL

Date/Time: Tue Jun 2 16:37:59 CEST 2009

Additional Info:

NTP CRITICAL: No response from NTP server

 

===checkcommand.cfg====================================

 

define command{

        command_name    notify-by-email

        command_line    /usr/bin/printf "%b" "TEST***** Nagios
*****\n\nNotificatio

n Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost:
$HOSTALIAS$\nAddress: $

HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
$LONGDATETIME$\n\nAdditional Info

:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service
Alert: $HOSTALI

AS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

}

 

But it doesn't run with snmp trap ?????:

 

===checkcommand.cfg====================================

 

Define command{

command_line    $USER1$/send_trap server_test public $HOSTNAME$
$SERVICEDESC$ $SERVICESTATEID$ $SERVICEOUTPUT$ $NOTIFICATIONTYPE$

}

 

===/usr/local/nagios/libexec/send_trap==========

 

/usr/bin/snmptrap -v 2c -c $2 $1 '' NAGIOS-NOTIFY-MIB::nSvcEvent \

nSvcHostname s "$3" nSvcDesc s "$4" nSvcStateID i $5 nSvcOutput s "$6"
nSvcNotifyType i "$7"

 

echo `date` >>//etc/nagios/send_trap_result.txt

echo "Param. 1:"$1 >>/etc/nagios/send_trap_result.txt

echo "Param. 2:"$2 >>/etc/nagios/send_trap_result.txt

echo "Param. 3:"$3 >>/etc/nagios/send_trap_result.txt

echo "Param. 4:"$4 >>/etc/nagios/send_trap_result.txt

echo "Param. 5:"$5 >>/etc/nagios/send_trap_result.txt

echo "Param. 6:"$6 >>/etc/nagios/send_trap_result.txt

echo "Param. 7:"$7 >>/etc/nagios/send_trap_result.txt

echo "Param. 8:"$8 >>/etc/nagios/send_trap_result.txt

echo "Param. 9:"$9 >>/etc/nagios/send_trap_result.txt

echo "Param.10:"$10 >>/etc/nagios/send_trap_result.txt

echo "Param.11:"$11 >>/etc/nagios/send_trap_result.txt

echo "Param.12:"$12 >>/etc/nagios/send_trap_result.txt

echo "Param.13:"$13 >>/etc/nagios/send_trap_result.txt

echo `date` >>//etc/nagios/send_trap_result.txt

 

===send_trap.result.txt===========================

 

Tue Jun 2 16:42:52 CEST 2009

Param. 1:<server test>

Param. 2:<password>

Param. 3:test1

Param. 4:Ntp

Param. 5:0

Param. 6:NTP

Param. 7:OK:

Param. 8:Offset

Param. 9:unknown

Param.10:<server test>

Param.11:<server test>

Param.12:<server test>

Param.13:<server test>

Tue Jun 2 16:42:52 CEST 2009

 

I'd like to receive in my snmp trap the nSvcNotifyType like :

Notification Type: PROBLEM 

Notification Type: RECOVERY

...

 

Do a trap snmp sending only a nSvcEvent NOTIFICATION-TYPE or a
nSvcNotify NOTIFICATION-TYPE too ?????

What's the difference between them ????

Where should I find documentation about that ????

 

regards

jerome 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090603/0908f9a4/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
-------------- next part --------------
_______________________________________________
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