I want to check if my website is up by search a string on that site, using the check_http plugin.
Is there an option I am missing or which method could I use to do this check?
but isn’t the purpose of the check_http plugin to check, whether the site I intend for users to see is up or not?
And a mistake on my part here, it is not exactly “my website” but rather a site the developers of my company have created for our customer, which has to be checked if it is available or not.
Try to use the developer tools of your browser and watch for communications of the java script with the back end. If you’r lucky, you can simulate the call and watch for the response with check_http. If this fails you will soon be at a point where you want to use test robots that run a zombified browser - I once did a poc with python and selenium GitHub - objectified/selmon: Nagios monitoring using Selenium / Webdriver.
I do 2 checks.
The first one is to check if the HEAD of the server response contains “HTTP/1.1 200”. I do that with “http_expect”.
The second check is a filter of a json file, which the site delivers and that contains all the data that is presented on the page. With the filter can specify a number of filtered values I expect to get an OK.
The check is a python script found here: check-json · PyPI