check_http for value more than

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
warhansen
Posts: 14
Joined: Tue May 12, 2015 5:46 am

check_http for value more than

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_http for value more than

Post 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.
Former Nagios Employee
warhansen
Posts: 14
Joined: Tue May 12, 2015 5:46 am

Re: check_http for value more than

Post by warhansen »

OK, It thought so.

Thank you,
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_http for value more than

Post by rkennedy »

No problem - do you have any further questions or are we good to mark this thread as resolved?
Former Nagios Employee
warhansen
Posts: 14
Joined: Tue May 12, 2015 5:46 am

Re: check_http for value more than

Post by warhansen »

You can mark as resolved, thanks.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: check_http for value more than

Post by avandemore »

Great, if you have further issues please open a new thread.
Previous Nagios employee
Locked