Check a HTML body ignoring the http error code

Good morning everyone,

is there anybody knowing a good way to check the HTML body of a URL ignoring the http error code? I can’t find anything like that but would need it to monitor a service.

Best regards


you can use the standard check_http plugin for this. There are two parameters you need to define:

  • -e to define the expected status code e.g. 301
  • -s to search for a string inside the body
/usr/lib/nagios/plugins/check_http -H myhost.local -e 301 -s nginx

This will expect a 301 status code and the string nginx inside the body. If any of this is not present the status will be critical. It is also possible to define multiple status codes with a comma seperated list.

The check_http plugin is part of the Icinga Template Library.

The custom variables you need to define are http_expect and http_string.

Best regards

1 Like

Thank you :bouquet:

I didn’t understand the -e parameter correct. Now it works!

1 Like