Page 1 of 1

check_http not working

Posted: Tue Feb 08, 2022 2:11 pm
by BanditBBS
So something I don't understand at all here, curl works fine and check_http gives me socket timed out:

CURL:

Code: Select all

[nagios@iss-chi-nag05 plugins]$ curl https://xxx.itconvergence.com

    <html>
        <script>
            document.cookie = "tg=; expires=Thu, 01 Jan 1970 22:00:00 GMT; path=/; secure";
            document.cookie = "sdesktop=; expires=Thu, 01 Jan 1970 22:00:00 GMT; path=/; secure";
            document.location.replace("/+CSCOE+/logon.html");
        </script>
    </html>
check_http:

Code: Select all

[nagios@iss-chi-nag05 plugins]$ ./check_http -H xxx.itconvergence.com --ssl -v
SSL initialized
GET / HTTP/1.1
User-Agent: check_http/v2.4.0.git (nagios-plugins 2.4.0)
Connection: close
Host: xxx.itconvergence.com
Accept: */*


CRITICAL - Socket timeout
The only thing I can guess is even though I tell it --ssl it initially tries http and that is blocked by firewalls. I could be completely off base with that guess as well, I'm just at a loss!

Re: check_http not working

Posted: Tue Feb 08, 2022 5:51 pm
by pbroste
Hello @BanditBBS

Thanks for reaching out, want to find out if you tried the following example as a test:

Code: Select all

/usr/local/nagios/libexec/check_http -H localhost -u https://ipchicken.com --ssl -v
If this is okay then run through this:

Code: Select all

./check_http -H xxx -u itconvergence.com --ssl -v
    • xxx --> hostaddress or in my case localhost
Let us know how that looks.

Thanks,
Perry

Re: check_http not working

Posted: Tue Feb 08, 2022 6:04 pm
by BanditBBS
Doing the first thing results in NagiosXI web page being loaded.

Doing the second thing results in invalid host name.

I'll PM you the actual full url so you can test.

Re: check_http not working

Posted: Wed Feb 09, 2022 12:10 pm
by BanditBBS
Hey @pbroste

The example you gave in PM isn't a valid example. It's going to load the web page of the IP you used in -H arguement. If you add a -v to show verbose, you'll see it isn't loading my webpage but instead is loading whatever page is at that IP you used.

Re: check_http not working

Posted: Wed Feb 09, 2022 2:45 pm
by pbroste
Hello @BanditBBS

My bad, thanks for bringing that to my attention, totally see what I did there.

Some more digging on this and we found where to make corrections:

First started out by testing via 'openssl' to get results:

Code: Select all

openssl s_client -connect xxx-xx-xxx-xxxxxxx.xxxxxxxxce.com:443
  • With results: "write:errno=104"
Then added this to the 'openssl' to pass: (just providing for info)
  • Code: Select all

    openssl s_client -connect xxx-xx-xxx-xxxxxxx.xxxxxxxxce.com:443 -no_tls1_2
Then took that to correct the 'check_http' command:
  • Code: Select all

    /usr/local/nagios/libexec/check_http --ssl -S xxx-xx-xxx-xxxxxxx.xxxxxxxxce.com
    
The results:
  • HTTP OK: HTTP/1.0 200 OK - 1433 bytes in 3.425 second response time |time=3.425184s;5.000000;10.000000;0.000000 size=1433B;;;0
Regards,
Perry

Re: check_http not working

Posted: Wed Feb 09, 2022 2:49 pm
by BanditBBS
Hey Perry,

Don't the --ssl and -S do the same exact thing, why are both required? I can validate it is working.

Re: check_http not working

Posted: Thu Feb 10, 2022 9:54 am
by pbroste
Hello @BanditBBS

Excellent, and yes you are correct that the -ssl and -S do the same.

Perry