Checking that a website returns a given string

In this recipe, we'll build on the basic web service monitoring established in the recipe Monitoring web services in this chapter and learn how to create a command that uses the check_http plugin to ensure that a particular string is included as part of an HTTP response.

By default, there's no Nagios Core command defined to use the plugin in this way, so the recipe will include defining a command before using it as part of a service check.

This may be necessary if we're monitoring a website on a server that may not necessarily return a 404 Not Found or similar error that will flag a WARNING or CRITICAL in Nagios; rather than merely checking if a document was found, we can check whether it matches a ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.