[Nagiosplug-help] check_http -m and binary (gif, in particular) responses
jon gold
dev at samizdatdigital.org
Thu Dec 30 19:01:02 CET 2004
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
>
>
More information about the Help
mailing list