[Nagiosplug-devel] [ nagiosplug-Bugs-1099682 ] check_http -m doesn't work for binary responses
SourceForge.net
noreply at sourceforge.net
Thu Jan 20 15:42:22 CET 2005
Bugs item #1099682, was opened at 2005-01-10 12:13
Message generated for change (Comment added) made by harpermann
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1099682&group_id=29880
Category: None
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: jon gold (samizdev)
Assigned to: Harper Mann (harpermann)
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?
----------------------------------------------------------------------
>Comment By: Harper Mann (harpermann)
Date: 2005-01-20 15:41
Message:
Logged In: YES
user_id=939531
Changed --minmax to --pagesize for long arg name and
updated usage and help.
----------------------------------------------------------------------
Comment By: Harper Mann (harpermann)
Date: 2005-01-20 15:00
Message:
Logged In: YES
user_id=939531
The plugin code was changed to get the page size from
Content-Length in the header. Also added max value to the -
m switch so can do "-m min:max". Retained "-m min"
convention so if there is no max defined, it will assume it's a
minimum size. Renamed long arg name from --min to --minmax
----------------------------------------------------------------------
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