Command line format for external notification.
Andreas Ericsson
ae at op5.se
Wed Jun 29 10:42:35 CEST 2005
aait at free.fr wrote:
> Hi,
>
> I actually work on Nagios 1.3 and want to perform an external
> notification via a perl script I developped. This script takes 5
> parametres ($HOSTNAME, $OUTPUT,....). I have a problem to make the
> $OUTPUT$ variable to be seen as one variable for my script.
>
> Example:
>
> define command{
> command_name notify-by-xmlrpc
> command_line /usr/lib/nagios/myagent/notification/my_script
> $HOSTNAME$ CRITICAL $OUTPUT$ $SERVICEDESC$ $DATETIME$
> }
>
Put single quotes around each macro.
> The problem is $OUTPUT$ because it's a string and each word of this
> string is seen as on parameter. If this variable is "The service is
> down" my script will do this association:
> OUTPUT=The
> SERVICEDESC=service
> DATETIME=is
>
> I have tested thess command lines without success:
> command_line /usr/lib/nagios/myagent/notification/my_script
> $HOSTNAME$ CRITICAL "$OUTPUT$" $SERVICEDESC$ $DATETIME$
> command_line /usr/lib/nagios/myagent/notification/my_script
> !$HOSTNAME$! CRITICAL !$OUTPUT$! !$SERVICEDESC$ ! !$DATETIME$!
>
>
> Finally, I had not found anything about my concern in the official
> documentation.
>
>
> Regards.
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> 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
>
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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