Page 1 of 1

Using check_http

Posted: Mon Jun 17, 2019 5:43 pm
by awilson
We are using the 2.1.1 version of check_http on Nagios XI 5.4.4
./check_http --help
check_http v2.1.1 (nagios-plugins 2.1.1)
Copyright (c) 1999 Ethan Galstad <[email protected]>
Copyright (c) 1999-2014 Nagios Plugin Development Team
<[email protected]>

I'm attempting to monitor a url of the form http://fqdn:port/path?p=home

There is only arg1 available. How should I configure the service check? I've tried separating the uri, the port, the host with options and also giving it in a single string with no options.

I get a 400 Bad Request Error warning.

Thanks!

Re: Using check_http

Posted: Tue Jun 18, 2019 8:13 am
by scottwilkerson
You should be able to use something like this

Code: Select all

/usr/local/nagios/libexec/check_http -H fqdn -u "/path?p=home" -p port -f follow
If you want to see where it is going wrong and what the server is responding, add -vvv to the check

Re: Using check_http

Posted: Thu Jun 27, 2019 11:41 am
by awilson
We got it working. I switched to check_xi_host_http and it uses the -H option instead of -I in check_http. I also used this format for the argument: -u "/path/ux-html/index.html?p=home" -p port -f follow
without single quotes around the complete set of arguments.

For general reference, should we use the quoting rules for the Bourne shell concerning expansions?

Thanks!

Re: Using check_http

Posted: Thu Jun 27, 2019 4:57 pm
by benjaminsmith
Hello @awilson,
We got it working.
Glad to hear you got it working.
For general reference, should we use the quoting rules for the Bourne shell concerning expansions?
My apologies, but can you elaborate on what you mean by expansions?

Thanks.

Re: Using check_http

Posted: Mon Jul 01, 2019 1:42 pm
by awilson
I should have just said quoting. When do we use single quotes and when do we use dbl quotes?

Thanks

Re: Using check_http

Posted: Mon Jul 01, 2019 3:30 pm
by benjaminsmith
Hi @awilson,

Generally speaking, single quotes won't interpolate anything and double quotes will.

Re: Using check_http

Posted: Mon Jul 01, 2019 3:47 pm
by awilson
Thank you!

You can close this.

Re: Using check_http

Posted: Mon Jul 01, 2019 4:03 pm
by benjaminsmith
Thank you!
You can close this.
Sounds good.

Thank you for using Nagios.