Page 1 of 1

Check_http with specific character

Posted: Fri Nov 30, 2012 11:34 am
by Koobal
Hi,
I see that there are other topics about that subject, but I have a particular case...
I had to check an URL with many specific character like ? , - , & ...
My problem is for the & ...
here is my URL :
http://xxxxxx.xx/yyyy.aspx?c=9dbb9b25-9 ... faf4fb&s=1

the problem is when i tried to configure with nagiosXI interface, the check cut my Url at the & like this :
http://xxxxxx.xx/yyyy.aspx?c=9dbb9b25-9 ... 4cb6faf4fb

Question is : How can I do ?
I tried simple quote, double quote around specifics chars, \ in front of chars...

here is my command :
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
-f ok -I 'XX.XX.XX.XX' -u '/yyyy.aspx?c=9dbb9b25-9e8f-489c-9d4a-ed4cb6faf4fb&s=1' -p 80

this is what NagiosXI returns me, when i make a test check command.
/usr/local/nagios/libexec/check_http -H http://xxxxxx.xx -f ok -I XX.XX.XX.XX -u \' /yyyy.aspx\?c=9dbb9b25-9e8f-489c-9d4a-ed4cb6faf4fb


Somebody can help me ?
Thanks,
Regards

Re: Check_http with specific character

Posted: Fri Nov 30, 2012 8:12 pm
by scottwilkerson
Actually this command looks perfect however there are some commands the do not escape correctly with the "test command" feature...

You should be able to run this from the command line and get the expected results

Code: Select all

/usr/local/nagios/libexec/check_http -H XXX.XXX.XXX.XXX -f ok -I 'XXX.XXX.XXX.XXX' -u '/yyyy.aspx?c=9dbb9b25-9e8f-489c-9d4a-ed4cb6faf4fb&s=1' -p 80

Re: Check_http with specific character

Posted: Mon Dec 03, 2012 4:59 am
by Koobal
Hi, thanks for the answer.
Yes I had check in command line and it was ok. I thought that the test command check was the same command than the service check, so i didn't finalize my service. Shame on me.
Service check is ok.
thanks.