[Nagiosplug-devel] [ nagiosplug-Bugs-1099682 ] check_http -m doesn't work for binary responses

SourceForge.net noreply at sourceforge.net
Mon Jan 10 12:14:10 CET 2005


Bugs item #1099682, was opened at 2005-01-10 20:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1099682&group_id=29880

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: jon gold (samizdev)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_http -m doesn't work for binary responses

Initial Comment:
(copied from my original message to the lists):

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?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1099682&group_id=29880




More information about the Devel mailing list