[Nagiosplug-devel] Check_http suggestion

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Jun 12 01:31:55 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/06/09 03:21 PM, Hiren Patel wrote:
> Marc Powell wrote:
>>
>> $ ~nagios/libexec/check_http -v -I cache01.davidson.tn.ena.net -p 8080  
>> -H transamrit.net -u http://transamrit.net:8082
>> GET http://transamrit.net:8082 HTTP/1.0
>> User-Agent: check_http/1.89 (nagios-plugins 1.4.3)
>> Host: transamrit.net
>>
>>
>> http://cache01.davidson.tn.ena.net:8080http://transamrit.net:8082 is  
>> 14868 characters
>> STATUS: HTTP/1.1 200 OK
>> **** HEADER ****
>> Content-Type: text/html; charset=iso-8859-1
>> Via: 1.1 cache01.davidson
>> Content-Length: 14690
>> Connection: close
>> Age: 0
>> Date: Thu, 11 Jun 2009 16:41:13 GMT
>> **** CONTENT ****
>> <html>
>> <head>
>> <title>BNBT Tracker Info</title>
>>
>> {snip}
>> HTTP OK HTTP/1.1 200 OK - 14868 bytes in 0.703 seconds | 
>> time=0.703203s;;;0.000000 size=14868B;;;0
>>
> ah okay, looks legit.
> from http://www.ietf.org/rfc/rfc2616.txt:
> -------
> 5.1 Request-Line
> 
>     The Request-Line begins with a method token, followed by the
>     Request-URI and the protocol version, and ending with CRLF. The
>     elements are separated by SP characters. No CR or LF is allowed
>     except in the final CRLF sequence.
> 
>          Request-Line   = Method SP Request-URI SP HTTP-Version CRLF
> 
> Request-URI    = "*" | absoluteURI | abs_path | authority
> 
> 
> .....
> 
> The absoluteURI form is REQUIRED when the request is being made to a
>     proxy. The proxy is requested to forward the request or service it
>     from a valid cache, and return the response. Note that the proxy MAY
>     forward the request on to another proxy or directly to the server 
> specified by the absoluteURI
> 
> ....
> 
> An example
>     Request-Line would be:
> 
>         GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
> -------
> sorry for the noise, seems -I and -u can be used to request from a proxy 
> then, not too sure about socks either.

I'm not against supporting proxies in check_http, but in the mean time
you could try that:

> $ plugins/check_http -I localhost -H www.w3.org -u http://www.w3.org/pub/WWW/TheProject.html -vvv
> GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
> User-Agent: check_http/v1.4.13.133.g18d6.dirty (nagios-plugins 1.4.13)
> Connection: close
> Host: www.w3.org

Also it is possible to pass multi-line requests with check_tcp... some
of my http checks are actually implemented with check_tcp because of
similar issues.


On a side note, every once in a while we talk about using a real http
library like curl for check_http... doing so would also allow proxy
support, and likely many other features...

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKMZPr6dZ+Kt5BchYRAo/sAKDm+too8QDh34y6c6K9gmpVXrGBAgCg0Ib7
G7S8RDUsqDcSE6vbLLmlLs4=
=9dLA
-----END PGP SIGNATURE-----




More information about the Devel mailing list