debugging notifications
Eric Doutreleau
Eric.Doutreleau at int-edu.eu
Mon Jan 21 21:53:17 CET 2008
Marc Powell a écrit :
>
>> -----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
>
thanks for your answer
i did that
and i got in my file
/usr/lib/nagios/plugins/notify_by_jabber
doutrele at jabberd.int-evry.fr,procacci at jabberd.int-evry.fr,gabor
et at jabberd.int-evry.fr,ghanotak at jabberd.int-evry.fr,gilles at jabberd.int-evry.fr
"***** Nagios ***** Not
ification Type: PROBLEM Service: mise a jour Host: serveur DNS primaire
Address: 157.159.10.12 State: CRI
TICAL Date/Time: Mon Jan 21 21:40:08 CET 2008 Additional Info: YUM
CRITICAL - updates found: 2 critica
l, 0 warning"
/usr/lib/nagios/plugins/notify_by_jabber
doutrele at jabberd.int-evry.fr,procacci at jabberd.int-evry.fr,gabor
et at jabberd.int-evry.fr,ghanotak at jabberd.int-evry.fr,gilles at jabberd.int-evry.fr
"***** Nagios ***** Not
ification Type: PROBLEM Service: mise a jour Host: serveur snmp Address:
157.159.21.5 State: CRITICAL Da
te/Time: Mon Jan 21 21:40:38 CET 2008 Additional Info: YUM CRITICAL -
updates found: 6 critical, 0 warn
ing"
if i run sh /tmp/jabber.txt i got the messages through jabber.
it seems that nagios just not able to launch directly the command
-------------------------------------------------------------------------
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