Use check_tcp to check OFTP server

CMK version:
1.6.0
OS version:
Appliance

Hello,

I am on the way to monitor OFTP Odette server is a live with help of check_tcp.

I can telnet to the host and get the following output:

OMD[DRP]:~/lib/nagios/plugins$ telnet 10.1.2.3 3305
Trying 10.1.2.3...
Connected to 10.1.2.3.
Escape character is '^]'.
IODETTE FTP READY

A following \n terminates the session.
Beside that the port is answering I also want to check if the correct response IODETTE FTP READY is sent. I tried different combinations of the option -e but none is working:

OMD[DRP]:~/lib/nagios/plugins$ ./check_tcp -H 10.1.2.3 -p 3305 -e 'IODETTE FTP READY' -vvv
Using service TCP
Port: 3305
flags: 0x2
server_expect_count: 1
        0: IODETTE FTP READY
looking for [IODETTE FTP READY] anywhere in []
couldn't find it
looking for [IODETTE FTP READY] anywhere in []
couldn't find it
received 24 bytes from host
#-raw-recv-------#

#-raw-recv-------#

I says it received 24bytes but in the raw I see nothing.

Anyone an idea what I am doing wrong?

Thanks

Michael

Hi Michael,

did you add the option “-A” in your call. This will use the expected strings instead of any. Also, I would like to send also a “\r\n” in the call.

Regards,
Christian

Hi Christian,

Thank you, still no luck:

OMD[DRP]:~/lib/nagios/plugins$ ./check_tcp -H 10.1.2.3 -p 3305 -s \\r\\n -A -e 'IODETTE FTP READY' -v
Using service TCP
Port: 3305
flags: 0x2
Send string: \r\n
server_expect_count: 1
        0: IODETTE FTP READY
looking for [IODETTE FTP READY] anywhere in []
couldn't find it
looking for [IODETTE FTP READY] anywhere in []
couldn't find it
received 24 bytes from host
#-raw-recv-------#

#-raw-recv-------#
TCP WARNING - Unexpected response from host/socket: |time=0.757110s;;;0.000000;10.000000

have you checked what this means?

Also not only in the RAW output is nothing but in the verbose output as well looking for [IODETTE FTP READY] anywhere in []

Have done a qick test myself, this sould look like this:

OMD[build]:~/local/lib/nagios/plugins$ ~/lib/nagios/plugins/check_tcp -H webbox -p 6556 -e "check_mk"  
TCP OK - 0.343 second response time on webbox port 6556 [<<<check_mk>>>]|time=0.342826s;;;0.000000;10.000000
OMD[build]:~/local/lib/nagios/plugins$ ~/lib/nagios/plugins/check_tcp -H webbox -p 6556 -e "check_mk" -vvv 
Using service TCP
Port: 6556
flags: 0x2
server_expect_count: 1
        0: check_mk
looking for [check_mk] anywhere in [<<<check_mk>>>
Version: 2.0.0p21
AgentOS: linux
]
found it
received 49 bytes from host
#-raw-recv-------#
<<<check_mk>>>
Version: 2.0.0p21
AgentOS: linux

#-raw-recv-------#
TCP OK - 0.064 second response time on webbox port 6556 [<<<check_mk>>>
Version: 2.0.0p21
AgentOS: linux]|time=0.064288s;;;0.000000;10.000000
OMD[build]:~/local/lib/nagios/plugins$ 

So i thik there is a connection issue, if you like you can do capture the network traffic with tcpdump. This might shed some light on the problem…

I see that odette sends 4 bytes before it sends out the prompt. Probably that´s confusing check_tcp

regards

Michael

and as far as I can see, these are non ASCII… have you tried to use the Check FTP for this?

The ASCII comes in the next package:

I am pretty sure that ODETTE FTP is different to normal FTP. Its an automotive standard.

thanks

Michael

I know, but it might be enough to connect and read the welcome message…

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.