Page 1 of 1

check_http for value more than

Posted: Tue Nov 22, 2016 5:17 am
by warhansen
Hi,

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

Code: Select all

check_http -H -s vvvvvvvvvv  -r > 500

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.

Thank you,

Warren.

Re: check_http for value more than

Posted: Tue Nov 22, 2016 11:31 am
by rkennedy
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.

For example -

Code: Select all

[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.

Re: check_http for value more than

Posted: Wed Nov 23, 2016 7:34 am
by warhansen
OK, It thought so.

Thank you,

Re: check_http for value more than

Posted: Wed Nov 23, 2016 1:32 pm
by rkennedy
No problem - do you have any further questions or are we good to mark this thread as resolved?

Re: check_http for value more than

Posted: Mon Dec 05, 2016 3:05 am
by warhansen
You can mark as resolved, thanks.

Re: check_http for value more than

Posted: Mon Dec 05, 2016 3:03 pm
by avandemore
Great, if you have further issues please open a new thread.