Page 1 of 1

Monitoring external website connectivity

Posted: Fri Apr 05, 2019 2:19 pm
by damianjyates
Is it possible to monitor connectivity between a external website and a nagios monitor without having to define host for each site to be monitored? I ask this because each host.cfg file I create for the external website shows in my hosts view as pending and its misleading as I am not monitoring the host the website is hosted on.

ex.

define host{
host_name lni ; The name we're giving to this host
alias secure.lni.wa.gov ; A longer name associated with the host
address 198.239.146.96 ; IP address of the host
;hostgroups Websites ; Host groups this host is associated with
check_command check_http_content!https://secure.lni.wa.gov!"home"
max_check_attempts 5
check_interval 5
retry_interval 1
check_period 24x7
contacts someone
notification_interval 60
notification_period 24x7
notifications_enabled 1
}

Re: Monitoring external website connectivity

Posted: Fri Apr 05, 2019 2:57 pm
by benjaminsmith
Hi @damianjyates,

In Nagios, you have hosts and services. Hosts can be either up, down or unreachable, while services can be in an ok, warning, critical and unknown state. All services must be associated to a host (i.e. device with an ip address). Typical checks for host are ping or icmp checks.

You might create the host definition and then a service checks for each website, but that depends on your monitoring requirements.

Also the use of templates will simplify your configurations as your host/service definitions can inherit common values.

See: Object Inheritance With Templates

If Nagios consistently shows pending try running your check command from the command line to make sure it's working correctly or restart the service:

Code: Select all

service nagios restart
service crond restart
Let us know if you get it setup and working as required.