Monitoring web services

In this recipe, we'll set up a service check to monitor the responsiveness of an HTTP and HTTPS server. We'll use the check_http command and the plugin of the same name provided in the Nagios Plugins setup for making HTTP and HTTPS requests of a web server, and ensure that it returns an appropriate and timely response. This is useful in situations where it's necessary to check if a website is still functioning, particularly if there are times it comes under heavy load or suffers denial of service attacks.

Getting ready

You should have a Nagios Core 4.0 or newer server with at least one host configured already. We'll use the example of sparta.example.net, a host defined in its own file. You should also understand the basics ...

Get Nagios Core Administration Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.