Nagios strips quotes from command arguments

Paul Lathrop paul at zicasso.com
Fri Dec 14 23:31:09 CET 2007


On Dec 14, 2007 2:21 PM, Sloane, Robert Raymond <sloane at ku.edu> wrote:
> I don't think the quotes are really disappearing, the echo command just
> doesn't see them because they are stripped by the shell. Try putting
> single quotes around the whole command line after the echo, and I
> suspect that your quotes will be visible:
>
> define command{
>         command_name            check-db-count
>         command_line            echo
> '/usr/local/lib/nagios/plugins/dbmon.py -H $HOSTADDRESS$ -u $USER3$ -p
> $USER4$ -d $ARG1$ -w $ARG3$ -c $ARG4$ "$ARG2$"' }

Sure enough, that proved that the quotes were actually there. Thanks!

> As for the "(No output)" It appears that Nagios isn't seeing anything on
> standard output from the command.  What happens if you change the
> command definition to:
>
> define command{
>         command_name            check-db-count
>         command_line            /usr/local/lib/nagios/plugins/dbmon.py
> -H $HOSTADDRESS$ -u $USER3$ -p $USER4$ -d $ARG1$ -w $ARG3$ -c $ARG4$
> "$ARG2$" >/tmp/dbmon.stdout 2>/tmp/dbmon.errout }

Turns out my plugin wasn't working when called from within Nagios. The
problem is now back in my plugin, not in Nagios! Thanks a lot, Bob!

--Paul

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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