passing arguments with spaces

Noel Platzke neufpas at gmail.com
Thu Sep 10 22:14:00 CEST 2009


I've tried everything possible.
I am completely lost.
I want to throw my keyboard through a window.
How in god's name do I get nagios to accept an argument that includes
spaces?

I have a service that uses the check_by_ssh plugin to run a script on a
remote server. The script takes an argument that is wrapped in quotes and
can potentially contain spaces.


Originally I had defined the command as

comand_name        check_by_ssh
command_line        /usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS$
--command=$ARG1$

which works fine for a service that looks like this...

check_by_ssh!"/usr/lib/nagios/plugins/check_load -w 5,5,5 -c 9,9,9"

but not for one that looks like this...

check_by_ssh!"/my/custom/script '$ARG1$'"

So I defined a new command...

command_name        my_custom_script
command_line           /usr/lib/nagios/plugins/check_by_ssh -H $HOSTADDRESS
--command="/my/custom/script '$ARG1$'"

and set up a new service...

my_custom_script!"this is my argument"

and that still fails. Wy are my quotes/spaces not being passed? What is
going on here? I have tried every combination of single quotes, double
quotes, escaping quotes, escaping spaces, and invoking the will of satan but
I can not get this thing to work. For the love of god help me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090910/7353d69b/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
-------------- 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