[Nagiosplug-devel] [Fwd: Re: [Nagiosplug-help] check_http -m and binary (gif, in particular) responses]

jon gold dev at samizdatdigital.org
Thu Jan 6 17:00:09 CET 2005


i posted this to nagios-help about a week ago, but no one seemed to have 
anything to say. i wonder if it's more appropriate for this list? in the 
original message, i forgot to include that i'm using 1.4b1.

jon

-------- Original Message --------
Subject: Re: [Nagiosplug-help] check_http -m and binary (gif, in 
particular) responses
Date: Thu, 30 Dec 2004 18:58:01 -0800
From: jon gold <dev at samizdatdigital.org>
To: jon gold <dev at samizdatdigital.org>
CC: nagiosplug-help at lists.sourceforge.net
References: <41D4BA2F.7090902 at samizdatdigital.org>

fwiw, i put a few printfs into check_http.c and confirmed that this is
the case -- pagesize is (minus the headers) the length of the gif.

jon

jon gold wrote:

> pardon me if i've overlooked any previous discussion about this, but i 
> couldn't find any in the sourceforge archives.
> 
> has anyone used check_http and -m to check that an image being returned 
> from a url is of an expected size? i tried -m with the number of bytes 
> i'm expecting, but the check fails. using -v from the shell, i can see 
> that in fact the Content-Type is gif, and the Content-Length is what i 
> expect for the byte count, but i can't find a way to use check_http to 
> get at or confirm that fact. the -s option seems to only work for the 
> body, and the -e only gets the first line.
> 
> looking at check_http.c, it seems that the length check is done with 
> strlen:
> 
>     if ((min_page_len > 0) && (page_len < min_page_len))
> 
> but since my page is a gif, and since strlen only goes up to the first 
> (and presumably string-terminating) 0, i assume i'm getting incorrect 
> results due to the fact that 0 is valid in the middle of a gif. i'll try 
> and build http.c for myself and make some changes to confirm this, but 
> it seems like a likely cause.
> 
> is there any reason not to use the value of pagesize which is computed 
> during the page retrieval instead of strlen? if there is, could we think 
> of adding a new switch, maybe something like --min-binary-length which 
> would not do a strlen check, but a pagesize one?
> 
> jon
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 
> 


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
::: Please include plugins version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null






More information about the Devel mailing list