[Nagiosplug-devel] [ nagiosplug-Bugs-706851 ] check_tcp misses expect string without newline
SourceForge.net
noreply at sourceforge.net
Mon Jun 2 03:41:06 CEST 2003
Bugs item #706851, was opened at 2003-03-20 07:15
Message generated for change (Comment added) made by kdebisschop
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=706851&group_id=29880
Category: None
Group: Release (specify)
Status: Open
Resolution: None
Priority: 5
Submitted By: Ade Rixon (aderixon)
Assigned to: Karl DeBisschop (kdebisschop)
Summary: check_tcp misses expect string without newline
Initial Comment:
In check_tcp.c 1.13, the following lines were added
(line 261):
if (buffer[i-2] == '\r' && buffer[i-1] == '\n')
break;
I have a TCP service that returns a string on
connection without a trailing newline. It used to be
detected by the -e option to check_tcp. The above code
breaks this behaviour and causes check_tcp to wait
until the timeout is reached, whereupon it fails.
Can this either be configurable, or be removed?
----------------------------------------------------------------------
>Comment By: Karl DeBisschop (kdebisschop)
Date: 2003-06-02 06:40
Message:
Logged In: YES
user_id=1671
I applied the proposed change the other day. I beleive it
should work for you - if you limit to 1 byte, it will make
only 1 recv() call.
Can you try a build from CVS or one of the daily snapshots
at http://nagiosplug.sourceforge.net/snapshot/ and let us
know how it goes for you? I hpe to close the issue out and
make a bug fix release soon.
(the option is -m or --maxbytes)
Thanks.
----------------------------------------------------------------------
Comment By: Ade Rixon (aderixon)
Date: 2003-06-02 03:52
Message:
Logged In: YES
user_id=145082
To clarify:
On connect to the port, the server immediately returns
either 'K' or 'N' (no trailing newline), which indicates
whether it is accepting requests or not.
If your proposed cap on bytes fetched means that I could
specify "fetch exactly one byte" and this would work then
yes, that is an acceptable solution.
----------------------------------------------------------------------
Comment By: Karl DeBisschop (kdebisschop)
Date: 2003-06-01 00:27
Message:
Logged In: YES
user_id=1671
The issue is not that the lines were added, it's that the
old version could fail if he first line of text was more
than MAXBUF char long.
1.12 calls recv once, 1.13 calls recv until the app stops
sending. Are you trying to monitor a streaming app by chance?
I propose that the solution is to add an option for a cap on
the number of bytes that check_tcp should fetch. Will that
work for you?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=706851&group_id=29880
More information about the Devel
mailing list