netcat/telnet client output not displayed when running from a remote jenkins job

328 views
Skip to first unread message

cridam

unread,
Jan 27, 2016, 4:05:43 PM1/27/16
to Jenkins Users
Hi

jenkins 1.644

when running a freestyle job, i want to collect data using a netcat (or telnet command) running inside a scripting shell on top a jenkins slave

body is not received when sending from jenkins job (see at the end)

#!/bin/bash
ping -c 1 IP  # always fine and port is listening
#KO no output
telnet IP PORT
#KO no output
ncat -i 2 IP PORT


I thought about an issue related  to  "terminal type negotiation".
I tried setting
export TERM=xterm ; # or dumb
but fails too.

Any ideas welcome.

output differs :

  • from jenkins
Trying IP...
Connected to IP.
Escape character is '^]'.
Connection closed by foreign host.


  • from host
Trying IP...
Connected to IP.
Escape character is '^]'.
my body is received
with everything expected

Connection closed by foreign host.

cridam

unread,
Feb 3, 2016, 11:37:03 AM2/3/16
to Jenkins Users
Using nc with --recv-only (server is pushing data when client connects in my case) serves me as workaround.
So it is a relative terminal related issue, probably fixable comparing env between host and ssh forked by jenkins


Reply all
Reply to author
Forward
0 new messages