check_http wrong HTTP code

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
majinfrede
Posts: 1
Joined: Wed Apr 04, 2018 3:47 am

check_http wrong HTTP code

Post by majinfrede »

Hi,

I'm using nagios plugins to check out the access of a web page : http://test.com/login
My site (http://test.com) is an http 80 site web with no https 443 access.
When i test the access of my web page i got some weird return from check_http :

check_http -H test.com/ -p 80 -u /login
=> HTTP OK - 301 (Moved Permanently)
check_http -H test.com/ -S -p 443 -u /login
=> HTTP OK - 200 (OK)

As i said, the script shouldnt acess the web site on 443, while he get a 200 OK return code. And he cant access though 80,
Do someone understand the behavior of the script here ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http wrong HTTP code

Post by scottwilkerson »

majinfrede wrote:check_http -H test.com/ -p 80 -u /login
=> HTTP OK - 301 (Moved Permanently)
check_http -H test.com/ -S -p 443 -u /login
=> HTTP OK - 200 (OK)
From your response here, it looks like the http version of the page at http://test.com/login is redirecting somewhere (probably the https version

you can test this by running

Code: Select all

curl -vvv http://test.com/login
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked