Solution: Exclamation Point Workaround

Brandon Knitter knitterb at blandsite.org
Sun Jun 19 18:28:05 CEST 2005


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$

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,

-- 
-bk








----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------
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