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.
I want to run a http_check that checks a website, gets a return value and I want to make sure that value is above X. We are doing a balance enquiry against one of our Applications, and we need to make sure the balance never goes below eg 500.
I see there is a option for regular expressions, so I wanted to do a
however I see the guys say to do a "> X" with a regular expression is impractical. (> 500 would be defined differently, I just want to show what I am trying to do)
I want to know if there is another option maybe that would make more sense to make sure I get a critical if a value is below X.
check_http actually cannot match variables the way you're looking to. The -s is meant for matching a string, and -r are meant for checking if text exits.
[root@bob libexec]# ./check_http -H google.com -s 222 -f follow
HTTP CRITICAL: HTTP/1.1 200 OK - string '222' not found on 'http://www.google.com:80/' - 10929 bytes in 0.239 second response time |time=0.239155s;;;0.000000 size=10929B;;;0
[root@bob libexec]#
You'll want to build something to encapsulate the variable you're after as a field, and then you could setup a check around it.