Nagios Core unreachable website checks

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.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios Core unreachable website checks

Post by t3dus »

I just setup another brand new Nagios server and problem is happening all over again.. Grr.

I followed these steps which I documented and have used in previous builds and didn't have this issue.
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Post by atc0005 »

Poor wording on my part. When I asked which server "the output" was from, I failed to clarify which output. I've quoted it above in an effort to be clearer.

Code: Select all

$ nmap -sT -p 80,443 snapgeek.com
Starting Nmap 7.80 ( https://nmap.org ) at 2022-03-11 11:30 CST
Nmap scan report for snapgeek.com (99.198.101.250)
Host is up (0.019s latency).
rDNS record for 99.198.101.250: fastcomet

PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 15.08 seconds
Is this output from the fully functional Nagios server or the one which is returning non-OK results?

If you haven't yet, I'd insert a firewall rule at the very top of the list/chain which accepts all connections from the Nagios server.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios Core unreachable website checks

Post by t3dus »

atc0005 wrote:Poor wording on my part. When I asked which server "the output" was from, I failed to clarify which output. I've quoted it above in an effort to be clearer.

Code: Select all

$ nmap -sT -p 80,443 snapgeek.com
Starting Nmap 7.80 ( https://nmap.org ) at 2022-03-11 11:30 CST
Nmap scan report for snapgeek.com (99.198.101.250)
Host is up (0.019s latency).
rDNS record for 99.198.101.250: fastcomet

PORT    STATE SERVICE
80/tcp  open  http
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 15.08 seconds
Is this output from the fully functional Nagios server or the one which is returning non-OK results?
That output is from the non fully functional nagios server.
atc0005 wrote:If you haven't yet, I'd insert a firewall rule at the very top of the list/chain which accepts all connections from the Nagios server.
Are you talking about on my local firewall?
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Post by atc0005 »

That output is from the non fully functional nagios server.
Thanks for clarifying.
Are you talking about on my local firewall?
I was referring to a local firewall on the snapgeek.com host (which nmap reports as 99.198.101.250) or anything that might be between the non-functioning Nagios server and it.

If 99.198.101.250 is the correct IP, I'd guess that something like SELinux or AppArmor might be causing trouble, or maybe even DNS.

One thing you can try is to specify a really long timeout value (say 120 or 240 seconds) and have two open ssh connections to the non-functioning Nagios server. From one, run the command as you have before. From the other, monitoring open connections to confirm which system the Nagios server is attempting to reach (e.g., netstat -na).

I think that plugin also has a verbose mode you can use to emit output.

You can also use curl to verify that the system is able to connect to the web server. e.g., curl --verbose http://snapgeek.com/

Perform all operations from the non-functioning Nagios server.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios Core unreachable website checks

Post by t3dus »

Well the thing is my other nagios server which is hosted by digital ocean has no problems reaching snapgeek.com or any website for that matter.

This problem nagios server also fails to monitor google when added
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Post by atc0005 »

I'd continue the troubleshooting efforts by checking DNS results, using curl and/or a CLI browser like lynx and other tooling to verify connectivity between the Nagios instance you're trying to fix and the website you'd like to monitor.

I'd also check whether apparmor or selinux are getting in the way if you find that curl or lynx work, but not the plugins.

You can also explicitly specify the IP address for check_http via "-I IP_ADDRESS_HERE".

Something like (assuming that 99.198.101.250 is correct):

/usr/local/nagios/libexec/check_http -H snapgeek.com -I 99.198.101.250

Don't forget that Nagios plugins usually offer a verbose flag. Use that to see if that provides any additional details.

Good luck figuring it out.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios Core unreachable website checks

Post by t3dus »

So odd..

For some reason I figured out if I add a -4 to the end of the checks then they succeed, which means my nagios server is defaulting to IPV6 instead of IPV4 for some unknown reason.

Code: Select all

root@nmon:~# /usr/local/nagios/libexec/check_http -H snapgeek.com -4
HTTP OK: HTTP/1.1 301 Moved Permanently - 502 bytes in 0.045 second response time |time=0.045287s;;;0.000000 size=502B;;;0

Code: Select all

root@nmon:~# /usr/local/nagios/libexec/check_http -H snapgeek.com
CRITICAL - Socket timeout
So with this I modified the check-host-alive command in commands.cfg

Code: Select all

##### ADDING -4 PARAMETER #####
# 'check-host-alive' command definition
define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -4 -H '$HOSTADDRESS$' -w 3000.0,80% -c 5000.0,100% -p 5
        }
subhamsinghh48
Posts: 3
Joined: Tue Mar 15, 2022 9:58 am

Re: Nagios Core unreachable website checks

Post by subhamsinghh48 »

I'd try running the check_ping command from the shell as defined in the command and see what happens.
subhamsinghh48
Posts: 3
Joined: Tue Mar 15, 2022 9:58 am

Re: Nagios Core unreachable website checks

Post by subhamsinghh48 »

I'd try running the check_ping command from the shell as defined in the command and see what happens. If check_http fails you might try check_icmp.
stream movies

9apps download
subhamsinghh48
Posts: 3
Joined: Tue Mar 15, 2022 9:58 am

Re: Nagios Core unreachable website checks

Post by subhamsinghh48 »

I'd try running the check_ping command from the shell as defined in the command and see what happens. If check_http fails you might try check_icmp.

hellodear.in

teatv apk download
Locked