Page 1 of 1

check_http error

Posted: Thu Apr 18, 2024 8:36 am
by vinmansbrew
Ran into an issue with the check_http plugin.
/usr/local/nagios/libexec/check_http -H "website.com"
No route to host
HTTP CRITICAL - Unable to open TCP socket

If I take out the website name, and put in the IP, it works.

HTTP OK: HTTP/1.1 301 Moved Permanently - 299 bytes in 0.375 second response time |time=0.374855s;;;0.000000 size=299B;;;0

It had been working, but the server needed to be upgraded. It was rhel 6.10, it's sitting on rhel 7.9, for now, but will get moved to 8.9 soon.

Still using iptables, though I'll probably change it to firewalld. Ntp checks in ok.

I don't have an issue using the IP, other than if the IP changes in the future. So, this is mostly academic.
Thanks!

Re: check_http error

Posted: Thu Apr 18, 2024 10:20 am
by bbahn
@vinmansbrew,

It would seem you are likely having an issue with DNS if the website name doesn't work, but the IP address does. Try running dig or nslookup with the "website.com". If it returns the IP address, then you know DNS is working and if not, then it isn't.

You can also try using ping on another website and its IP address to see if it's a more general issue
i.e.

Code: Select all

ping 8.8.8.8
ping google.com

Re: check_http error

Posted: Fri Apr 19, 2024 11:14 am
by vinmansbrew
Well, I can dig and nslookup, so dns should be ok.
I didn't think that would be the issue, since it resolved fine, before the upgrade from rhel 6 to 7.
Core version is 4.5. I supposed it could just be a plugin config. Not entirely sure how to check plugin version.

Re: check_http error

Posted: Tue Apr 23, 2024 1:27 am
by peterjon
Yes I Facing Thise Problem