Page 1 of 1

check_http wrong HTTP code

Posted: Wed Apr 04, 2018 3:56 am
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 ?

Re: check_http wrong HTTP code

Posted: Wed Apr 04, 2018 9:24 am
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