Hi,
I'm trying to check URL's for a few sites. Some I control the servers and others are hosted so I can't put the client on them.
When I define a check_http service in my localhost.cfg it never shows that the URL isn't reachable even when I turn off the server. But if I add it to my windows.cfg file it works fine. Has anyone experienced this?
Also, for machines I can't install the client on and I just want to monitor the URL, should I still make a cfg file for them or can I just add the URL to an existing one? How do you handle monitoring URLs?
Thanks.
J
check_http from localhost.conf gives false positives.
-
badassmexican
- Posts: 1
- Joined: Mon Jun 20, 2016 8:22 pm
Re: check_http from localhost.conf gives false positives.
Is the service for your localhost machine? If so, when you turn it off then the machine of Nagios is also going off as well so it can't continue to monitor.When I define a check_http service in my localhost.cfg it never shows that the URL isn't reachable even when I turn off the server. But if I add it to my windows.cfg file it works fine. Has anyone experienced this?
Yes, usually people create a config for a host, and then another config for the services under that specific host. Others use one config per host / service -- it's really up to you. The important thing to Nagios, is that you have all of your configuration files linked to nagios.cfg. You can do this using the cfg_dir= variable like so -Also, for machines I can't install the client on and I just want to monitor the URL, should I still make a cfg file for them or can I just add the URL to an existing one?
Code: Select all
cfg_dir=/usr/local/nagios/etc/static
You can do so like this -How do you handle monitoring URLs?
Code: Select all
[nagios@localhost libexec]$ ./check_http -H google.com
HTTP OK: HTTP/1.1 301 Moved Permanently - 559 bytes in 0.091 second response time |time=0.091321s;;;0.000000 size=559B;;;0
Code: Select all
define host {
use linux-server
host_name google
alias Google.com monitoring
address google.com
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
}
define service {
use generic-service
host_name google
service_description HTTP
check_command check_http!-H google.com
}
Former Nagios Employee