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

Nagios Core unreachable website checks

Postby t3dus » Tue Feb 22, 2022 3:14 pm

Fresh install of Nagios core on a new server and it can't reach any websites for ping or check_http checks

I'm not sure why because I can ping these websites from within the server itself so the server can reach these sites but nagios core claims every website i have configured is unreachable..

How can I resolve this?
Attachments
nagios unreachable.PNG
User avatar
t3dus
 
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Re: Nagios Core unreachable website checks

Postby t3dus » Tue Feb 22, 2022 4:50 pm

If i go into /var/log/apache2/error.log

I see a bunch of errors like this

[Tue Feb 22 15:39:01.535520 2022] [php7:notice] [pid 790] [client IP ADDRESS HIDDEN] PHP Notice: Trying to access array offset on value of type bool in /usr/local/nagios/share/includes/utils.inc.php on line 154,
User avatar
t3dus
 
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Re: Nagios Core unreachable website checks

Postby gormank » Tue Feb 22, 2022 5:31 pm

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.
You may also post the service and command definitions for http and ping as well.
gormank
 
Posts: 992
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios Core unreachable website checks

Postby t3dus » Tue Feb 22, 2022 6:07 pm

gormank wrote: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.
You may also post the service and command definitions for http and ping as well.

I was trying to figure out the command for that and where to run it from but I don't think I have the correct commands.
User avatar
t3dus
 
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Re: Nagios Core unreachable website checks

Postby t3dus » Tue Feb 22, 2022 6:11 pm

gormank wrote: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.
You may also post the service and command definitions for http and ping as well.

Figured out the command. Apparently it works for google.com but not my own websites though it works fine on my second nagios server..
Attachments
nagios check.PNG
nagios check.PNG (7.71 KiB) Viewed 967 times
User avatar
t3dus
 
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 11:58 am

This is still an unsolved issue that I'd like some support with. Thank you
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 12:20 pm

One approach that has worked well for me in the past when troubleshooting service checks is to run them as the same user account that executes the plugin and also run the commands with the same arguments as the Nagios instance.

1) Login to Nagios Core system/console
2) sudo --login --user nagios
3) /usr/local/nagios/libexec/check_http -H snapgeek.com
4) ping snapgeek.com
5) nmap -sT -p 80,443 snapgeek.com
6) nmap -sT -Pn -p 80,443 snapgeek.com


The last command disables using ping to determine if the host is up before attempting to connect to the ports. If you don't have nmap installed it's worth installing on the Nagios box for this and future troubleshooting tasks.

Based on what you've noted, it may be that 80/tcp (non-https) is the default for check_http and you don't have that port exposed to Nagios.
atc0005
 
Posts: 25
Joined: Thu Oct 28, 2021 2:03 pm

Re: Nagios Core unreachable website checks

Postby t3dus » Fri Mar 11, 2022 12:26 pm

atc0005 wrote:One approach that has worked well for me in the past when troubleshooting service checks is to run them as the same user account that executes the plugin and also run the commands with the same arguments as the Nagios instance.

1) Login to Nagios Core system/console
2) sudo --login --user nagios
3) /usr/local/nagios/libexec/check_http -H snapgeek.com
4) ping snapgeek.com
5) nmap -sT -p 80,443 snapgeek.com
6) nmap -sT -Pn -p 80,443 snapgeek.com


The last command disables using ping to determine if the host is up before attempting to connect to the ports. If you don't have nmap installed it's worth installing on the Nagios box for this and future troubleshooting tasks.

Based on what you've noted, it may be that 80/tcp (non-https) is the default for check_http and you don't have that port exposed to Nagios.

When I run the commands below it fails on snapgeek.com but works on google.com

Code: Select all
$ /usr/local/nagios/libexec/check_http -H snapgeek.com
CRITICAL - Socket timeout
$ /usr/local/nagios/libexec/check_http -H google.com
HTTP OK: HTTP/1.1 301 Moved Permanently - 547 bytes in 2.574 second response time |time=2.573851s;;;0.000000 size=547B;;;0


port 443 is open on host. I have another nagios server which can use the same checks on my website
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
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 2:37 pm

t3dus wrote:port 443 is open on host. I have another nagios server which can use the same checks on my website


Is the output you provided from the nagios server reporting "CRITICAL - Socket timeout", or from the second nagios server that you mentioned?

Do you get the same results when running "host snapgeek.com" from each 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 4:54 pm

atc0005 wrote:
t3dus wrote:port 443 is open on host. I have another nagios server which can use the same checks on my website


Is the output you provided from the nagios server reporting "CRITICAL - Socket timeout", or from the second nagios server that you mentioned?

Do you get the same results when running "host snapgeek.com" from each nagios server?

No that output is from this broken nagios server. The other server everything works and shows up like that google output.
User avatar
t3dus
 
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA

Next

Return to Community Support

Who is online

Users browsing this forum: No registered users and 15 guests