Monitoring external website connectivity

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
damianjyates
Posts: 1
Joined: Wed Apr 03, 2019 12:34 pm

Monitoring external website connectivity

Post 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
}
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Monitoring external website connectivity

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked