Solution: Exclamation Point Workaround
Andreas Ericsson
ae at op5.se
Sun Jun 19 23:08:47 CEST 2005
Brandon Knitter wrote:
> I'm not sure if this has been mentioned before, but I was having an issue where
> my password to a database had a "!" in it. So the service had the following:
>
> check_command check_database host!port!user!password!
>
> Where the password was "password!". Of course you can't do that cause the
> exclamation is a separator and a reserved character. So I changed my commmand
> from:
>
> command /path/to/check_database.sh $ARG1$ $ARG2$ $ARG3$ $ARG4$
>
> to the following:
>
> command printf "$ARG3$ $ARG4$" | xargs /path/to/check_database.sh $ARG1$
> $ARG2$
>
A simpler solution is ofcourse to define the command as
check_database.sh '$ARG1$' '$ARG2$' '$ARG3$' '$ARG4$'
and the service as
check_command check_database!host!port!user!password\!
> and then in my object definition, I changed my check command to:
>
> check_command check_database host!port!user!password\x21
>
> The printf command will expand the "\x21" to a "!" when executing things. It's
> a nice little workaround that I found and figured I'd share. :) Hope this
> helps y'all.
>
> Cheers,
>
--
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