Nagios Core unreachable website checks
Nagios Core unreachable website checks
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?
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?
Re: Nagios Core unreachable website checks
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,
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,
Re: Nagios Core unreachable website checks
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.
You may also post the service and command definitions for http and ping as well.
Re: Nagios Core unreachable website checks
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.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.
Re: Nagios Core unreachable website checks
Figured out the command. Apparently it works for google.com but not my own websites though it works fine on my second nagios server..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.
- Attachments
-
- nagios check.PNG (7.71 KiB) Viewed 2093 times
Re: Nagios Core unreachable website checks
This is still an unsolved issue that I'd like some support with. Thank you
Re: Nagios Core unreachable website checks
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.
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.
Re: Nagios Core unreachable website checks
When I run the commands below it fails on snapgeek.com but works on google.comatc0005 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.
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
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
Re: Nagios Core unreachable website checks
Is the output you provided from the nagios server reporting "CRITICAL - Socket timeout", or from the second nagios server that you mentioned?t3dus wrote:port 443 is open on host. I have another nagios server which can use the same checks on my website
Do you get the same results when running "host snapgeek.com" from each nagios server?
Re: Nagios Core unreachable website checks
No that output is from this broken nagios server. The other server everything works and shows up like that google output.atc0005 wrote:Is the output you provided from the nagios server reporting "CRITICAL - Socket timeout", or from the second nagios server that you mentioned?t3dus wrote:port 443 is open on host. I have another nagios server which can use the same checks on my website
Do you get the same results when running "host snapgeek.com" from each nagios server?