check_http not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2461
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

check_http not working

Post 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!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: check_http not working

Post 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
User avatar
BanditBBS
Posts: 2461
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check_http not working

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2461
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check_http not working

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: check_http not working

Post 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
User avatar
BanditBBS
Posts: 2461
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: check_http not working

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: check_http not working

Post by pbroste »

Hello @BanditBBS

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

Perry
Locked