debugging notifications

Marc Powell marc at ena.com
Mon Jan 21 19:19:42 CET 2008



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Eric Doutreleau
> Sent: Monday, January 21, 2008 11:32 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] debugging notifications
> 
> i have a problem with my script to send notification by jabber.
> 
> i have put on my command file
> 
> define command{
>        command_name    notify-by-jabber
>        command_line    /usr/lib/nagios/plugins/notify_by_jabber
> $CONTACTEMAIL$
> "***** Nagios  *****   Notification Type: $NOTIFICATIONTYPE$ Service:
> $SERVICEDE
> SC$ Host: $HOSTALIAS$ Address: $HOSTADDRESS$ State: $SERVICESTATE$
> Date/Time: $
> LONGDATETIME$  Additional Info:  $SERVICEOUTPUT$"
>        }
> 
[chop]

> 
> i m wondering how i can debug the notification and to see what command
> is spawn when a notification is sent

Change your command definition to echo the command that would be run to
a file --

define command{
       command_name    notify-by-jabber
       command_line    echo '/usr/lib/nagios/plugins/notify_by_jabber 
$CONTACTEMAIL$ "***** Nagios  *****   Notification Type:
$NOTIFICATIONTYPE$ Service: $SERVICEDESC$ Host: $HOSTALIAS$ Address:
$HOSTADDRESS$ State: $SERVICESTATE$  Date/Time: $LONGDATETIME$
Additional Info:  SERVICEOUTPUT$"' > /tmp/nagios.txt
       }

/tmp/nagios.txt would then contain the full command line that nagios
would attempt to run.

--
Marc


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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