check_http Question

Andreas Ericsson ae at op5.se
Tue Jun 28 10:00:14 CEST 2005


Corey Mosher wrote:
> I have a page that I want to check on a remote server to see what the
> content is.  The content returned is like this:
> 
> Testing
> 1 Item Locked
> 
> What I want to check is whether the number is greater than 8 or not. 
> If so it should become CRITICAL.  My check command is using check_http
> and looks like this right now:
> 
> /usr/lib/nagios/plugins/check_http -H hostname.domain.com -u
> /status.txt -r "([0-9]+) Item Locked"
> 
> Now this only detects whether the content has that line or not.  What
> I need is to use regex grouping to get the value and test that it's
> below a certain number (8).  How can I do this?  Am I even using the
> correct approach?
> 

check_http -H hostname.domain.com -u /status.txt -r "([0-8]) Item locked"

should do the trick. Other than that, you're down to parsing numbers and 
you would need a completely different plugin for that (custom-made, 
probably).

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list