[Nagiosplug-help] check_tcp does not intercept Unicode responses
James Miller
jimm at simutronics.com
Fri May 18 20:51:51 CEST 2007
Hello everyone
I have an app I want to watch using the check_tcp plug-in. The issue is the
app sends it responses in Unicode and check_tcp doesn't seem to know how to
interpret the response. It sees the first I in the response, quits reading
the rest of the response after it see the first '\0' and it thinks the
service is UP.
The command I run is (from the command line:
./check_tcp -v -H <my_host> -p <my_tcp_port> -s $'ISWORLDUP\t2025\n' -e
$'I\0S\0W\0R\0L\0D\0U\0P\0\t\0Y\0E\0S\0\n'
Using service TCP
Port: 0
flags: 0x2
server_expect_count: 1
0: I
received 27 bytes from host
#-raw-recv-------#
I
#-raw-recv-------#
looking for [I] anywhere in [I]
found it
TCP OK - 0.162 second response time on port 49276
[I]|time=0.161719s;0.000000;0.000000;0.000000;10.000000
When a 'world is down' the response is "ISWORLDUP NO" or in Unicode
"I\0S\0W\0O\0R\0L\0D\0U\0P\0\t\0N\0O\n"
Here's an example from strace if I telnet to the app and check to see if the
world is UP:
read(0, "ISWORLDUP\t2025\n", 8160) = 15
select(4, [0 3], [3], [3], {0, 0}) = 1 (out [3], left {0, 0})
send(3, "ISWORLDUP\t2025\n", 15, 0) = 15
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL) = 1 (in [3])
recv(3, "I\0S\0W\0O\0R\0L\0D\0U\0P\0\t\0Y\0E\0S\0\n", 8142, 0) = 27
select(4, [0 3], [1], [3], {0, 0}) = 1 (out [1], left {0, 0})
write(1, "I\0S\0W\0O\0R\0L\0D\0U\0P\0\t\0Y\0E\0S\0\n", 27ISWORLDUP YES
) = 27
select(4, [0 3], [], [3], {0, 0}) = 0 (Timeout)
select(4, [0 3], [], [3], NULL
I was hoping someone might have some insight to this issue.
Thanks,
Jim
James Miller - MCSE RHCE CISSP
Sr Systems & Network Administrator
Simutronics Corp.
www.play.net
636.946.4263 x113
More information about the Help
mailing list