Escaping Exclamation Points

Anthony Montibello amontibello at gmail.com
Sat Jun 28 01:07:18 CEST 2008


I actually define the following Service configs to help deal with these
issues.

define command{

command_name check_nt_l

command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 1248 -v $ARG1$ -l "$ARG2$"

}

THen I use the following for the service definition.

check_nt_l!SERVICESTATE !Act\! Scheduler



I have not tested in NSClinet++, but have tested this configuration through
NC_NEt.

The primary problem was the ! in the service definition was Tokenizing the
parameter into differerent $ARGX$

All nagios plugins would have this same issue,Another common issue is the
$ where using $$ usually works.



TOny (Author of NC_NEt)

On Fri, Jun 27, 2008 at 8:24 AM, Marc Powell <marc at ena.com> wrote:

>
> On Jun 27, 2008, at 6:42 AM, Christopher Falk wrote:
>
> > Problem resolved.
> >
> > What I just ended up doing is creating a new command,
> > check_act_scheduler identical to the check_nt_service command
> > definition, and hard-coding 'Act! Scheduler' instead of $ARG1$. That
> > took care of it.
>
> New feature in 3.x --
>
> http://nagios.sourceforge.net/docs/3_0/whatsnew.html
>
> Escaped command arguments - You can now pass bang (!) characters in
> your command arguments by escaping them with a backslash (\). If you
> need to include backslashes in your command arguments, they should
> also be escaped with a backslash.
>
> --
> Marc
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20080627/9ac95a34/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
-------------- 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