check_http -r search for sentence

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
JonWard50
Posts: 1
Joined: Thu Apr 04, 2019 8:25 am

check_http -r search for sentence

Post by JonWard50 »

We are successfully reporting on individual words on a web page with the plugin [check_http], but checking for sentences/more than one word is not working.

For example:
./check_http -H <host name> -u "/plugins/servlet/applications/versions-licenses" -w 20 -c 30 --ssl -R "license has expired" -a <user>:<password> -f follow --invert-regex

Do we need some sort of escape character to specify the spaces between each words in -R "license has expired"

Any help or suggestions appreciated.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http -r search for sentence

Post by scottwilkerson »

This appears to work for me, you can test here:

Code: Select all

/usr/local/nagios/libexec/check_http -H www.nagios.com -u "/" -w 20 -c 30 --ssl -R "Nagios XI provides monitoring" -f follow --invert-regex
Are you sure that the string you are searching for is produced by the HTML of the page, and not via javascript after the page loads?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked