check_http Question

Marc Powell marc at ena.com
Mon Jun 27 22:04:17 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Corey Mosher
> Sent: Monday, June 27, 2005 2:32 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_http Question
> 
> 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?

The test functionality you are looking for doesn't exist in that plugin.
I think it would be pretty straightforward to write a small specialized
perl plugin to do that though using the LWP module. Probably less than 2
dozen lines with error checking...

--
Marc


-------------------------------------------------------
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_idt77&alloc_id492&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