Using check_http

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Using check_http

Post 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!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Using check_http

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Using check_http

Post 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!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_http

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Using check_http

Post by awilson »

I should have just said quoting. When do we use single quotes and when do we use dbl quotes?

Thanks
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_http

Post by benjaminsmith »

Hi @awilson,

Generally speaking, single quotes won't interpolate anything and double quotes will.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Using check_http

Post by awilson »

Thank you!

You can close this.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_http

Post by benjaminsmith »

Thank you!
You can close this.
Sounds good.

Thank you for using Nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked