Checking that a website returns a given string
In this recipe, we'll build on the basic web service monitoring established in the Monitoring web services recipe 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
state in Nagios; rather than merely checking if a document was found, we can check if it matches ...
Get Nagios Core Administration Cookbook 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.