help with check_http with ampersand (&) in URL

nagios at mm.quex.org nagios at mm.quex.org
Mon Jan 10 09:35:14 CET 2005


On Mon, Jan 10, 2005 at 02:07:10PM +1100, S. H. wrote:
> hi all
> 
> can check_http check links with ampersand (&) characters in the url.
> An example url would be: 
> http://intl.yahoo.asia.studylink.com/results/results.html?page=1&study-locations=&levels-of-study=&keywords=it
> 
> when i try the above url i get strange results that nagios doesn't
> understand. example:
> 
> root at vmNagios:/usr/local/nagios/libexec# ./check_http -H
> intl.yahoo.asia.studylink.com -u
> /results/results.html?page=1&study-locations=&levels-of-study=&keywords=it
> [1] 394
> [2] 395
> bash: study-locations=: command not found
> [3] 396
> bash: levels-of-study=: command not found
> [2]   Exit 127                study-locations=
> [3]+  Exit 127                levels-of-study=
> root at vmNagios:/usr/local/nagios/libexec# HTTP ok: HTTP/1.0 302 Moved
> Temporarily -   0.358 second response time |time=  0.358
> 
> any help much appreciated

This is because the ampersand character tells the shell to run the
command in the background; this is shown by the three tasks that
were started running.

You need to quote the URL; i.e.

check_http ... -u 'http://foo.com/?foo=bar&bar=baz'

would work.

For Nagios, modify the check command to have quotes around the
argument that represents the URL and it should be fine.


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
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