[Nagiosplug-devel] [ nagiosplug-Patches-1346104 ] check_tcp -s/-q line ends not handled consistently
SourceForge.net
noreply at sourceforge.net
Wed Mar 22 08:37:08 CET 2006
Patches item #1346104, was opened at 2005-11-02 11:06
Message generated for change (Comment added) made by rouilj
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1346104&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Bugfix
Group: None
Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: John Rouillard (rouilj)
Assigned to: Ton Voon (tonvoon)
Summary: check_tcp -s/-q line ends not handled consistently
Initial Comment:
check_tcp adds a \r\n to the quit string specified by
-q but
not to the send string specified with -s. This is confusing
and also makes it a major pain to test services using
check_tcp where the service expects an alternate line
ending.
This is even more difficult if using something like
check_by_ssh to perform the remote check_tcp invocation.
The attached patch against the 1.4.2 released check_tcp
adds a "-l <b|e|n|r>" flag that allows the line ending
to be set
to 'b'oth <cr><lf>, 'e'mpty, 'n'ewline or 'r'eturn. The
default
is "-l e" for the -s string and "-l b" for the quit
string replicating current behavior.
-- rouilj-np at renesys.com
----------------------------------------------------------------------
>Comment By: John Rouillard (rouilj)
Date: 2006-03-22 11:36
Message:
Logged In: YES
user_id=707416
Set up a simple server using netcat
nc -l -p 3333 | od -c ) and connect to it using:
check_tcp -le -s send -le -q quit -H localhost -p 3333
you should see "s e n d q u i t". Which may be an bug
as I see: "s e n d q u i t \r \n" when
I tried the above. Looks like the -le argument isn't
suppressing the \r\n line ending for the quit string.
check_tcp -ln -s send -q quit -H localhost -p 3333
should (and does) produce:
"s e n d \n q u i t \n"
and so forth.
-- rouilj
----------------------------------------------------------------------
Comment By: Ton Voon (tonvoon)
Date: 2006-03-22 10:44
Message:
Logged In: YES
user_id=664364
John,
Thanks for the patch. Have applied to CVS HEAD.
Have you got any suggestions on how to test?
Ton
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397599&aid=1346104&group_id=29880
More information about the Devel
mailing list