check_http

David Johnson djohnson at jsatech.com
Thu Jan 12 16:52:59 CET 2006


I second that advice. Although I prefer awk.



-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Mike Holloway
Sent: Thursday, January 12, 2006 9:47 AM
To: nagios-users at lists.sourceforge.net
Subject: Re: [Nagios-users] check_http


Easiest way would probably be to just hack on check_http.c to suit  
your needs (search for HTTP OK) and then recompile and copy the  
executable to your libexec folder.  A more convoluted way would be to  
write a script (sh or perl) that execs check_http and then passes the  
output through a stream editor and exits with the same exit code as  
check_http.  You would need to make a new checkcommand, maybe:

define command{
	command_name		check_http_formatted
         command_line		$USER1$/check_http_formatted.sh $ARG1$
$ARG2$  
$ARG3$ $USER1$
}

and then for check_http_formatted.sh something like:

#!/bin/bash
output=`$4/check_http -H $1 -w $2 -c $3`
exitcode=$?
echo $output | sed -e 's/HTTP/$1 HTTP/'
exit($exitcode)



-mike



On Jan 12, 2006, at 3:26 AM, Richard Gliebe wrote:

> I'm checking some local websites with the check_http plugin.
>
> [...]
> # 'check_http_alias' command definition
>         command_name    check_http_alias
>         command_line    $USER1$/check_http -H $ARG1$ -w $ARG2$ -c  
> $ARG3$
> ..
> ..
> where $ARG1$ is www.xyz.com ! $ARG2$ is 2 ! $ARG2$ is 5
> [...]
>
> Works fine ;-)
>
> But now I want to manipulate the output from:
>
> [...]
> HTTP OK HTTP/1.1 200 OK - 42488 bytes in 0.013 seconds
> to
> www.xyz.com OK HTTP/1.1 200 OK - 42488 bytes in 0.013 seconds
> [...]
>
> any thinks ?
>
> thanks in advance
> Richard
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through  
> log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD  
> SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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