check_http - Receiving 200 OK message for wrong credentials

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
fsbeaunix
Posts: 31
Joined: Mon Apr 20, 2015 2:58 pm
Location: Michigan, USA

check_http - Receiving 200 OK message for wrong credentials

Post by fsbeaunix »

Hello,

I'm trying to enable the monitoring for one of our application console url using check_http plugin. But when I run the script below I'm getting
STATUS: HTTP/1.1 200 OK response. Although this is the response I'm looking for, I get the same response when I enter the wrong credentials. Please advise what changes I have to make to my script.

Below is the url and the script format I used to do the health check for the application console.

url for the console:
http://servername.domain.com:port/

Script used for health check:
./check_http -v -H servername.domain.com -p port -u http://servername.domain.com:port/console/App.html\#home -a "username:password"

Thank you,
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_http - Receiving 200 OK message for wrong credenti

Post by cdienger »

The -a option simply inserts the credentials into the HTTP request header and the site determines what to respond with. The site may not actually need the creds to return a 200 response. What is the output if you run it without this option?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
fsbeaunix
Posts: 31
Joined: Mon Apr 20, 2015 2:58 pm
Location: Michigan, USA

Re: check_http - Receiving 200 OK message for wrong credenti

Post by fsbeaunix »

Hello,
I removed the option to enter the credentials and ran the script. It gave STATUS: HTTP/1.1 200 OK response. I also enabled the monitoring for lower environments and brought down the instance to see what status it will give. I got a Connection Refused and HTTP CRITICAL - Unable to open TCP socket response.

I'm just concerned about the health check of the instance and not the application so I'm good with this approach so far. Thank you!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http - Receiving 200 OK message for wrong credenti

Post by scottwilkerson »

fsbeaunix wrote:Hello,
I removed the option to enter the credentials and ran the script. It gave STATUS: HTTP/1.1 200 OK response. I also enabled the monitoring for lower environments and brought down the instance to see what status it will give. I got a Connection Refused and HTTP CRITICAL - Unable to open TCP socket response.

I'm just concerned about the health check of the instance and not the application so I'm good with this approach so far. Thank you!!
Great,

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked