We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Nagios Core unreachable website checks

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 4:58 pm

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

Re: Nagios Core unreachable website checks

Postby atc0005 » Fri Mar 11, 2022 5:03 pm

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.
atc0005
 
Posts: 25
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 5:09 pm

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

Re: Nagios Core unreachable website checks

Postby atc0005 » Fri Mar 11, 2022 5:18 pm

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.
atc0005
 
Posts: 25
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 5:24 pm

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

Re: Nagios Core unreachable website checks

Postby atc0005 » Fri Mar 11, 2022 5:30 pm

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.
atc0005
 
Posts: 25
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 10:48 pm

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

Re: Nagios Core unreachable website checks

Postby subhamsinghh48 » Tue Mar 15, 2022 10:02 am

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

Postby subhamsinghh48 » Thu Mar 17, 2022 3:35 am

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

tiutmvpmfg

Postby CarlNearl » Wed Mar 23, 2022 5:41 pm

CarlNearl
 
Posts: 1
Joined: Fri Feb 22, 2019 4:11 pm
Location: USA

PreviousNext

Return to Community Support

Who is online

Users browsing this forum: No registered users and 22 guests