PDA

View Full Version : Telnet does not work very well


nasa_d
10-21-2010, 12:21 AM
Telnet step does not have detailed documentation. I tried a simple rm file command and this says the script executed successfully but never worked. I used SSH mode. The version I tried is 7.7.

Please check if I need to do something else?

kinook
10-21-2010, 10:14 AM
In our tests, the attached project produces the expected output of:

10/21/2010 9:08:09 AM: -------------------- Starting Build: 'SSH.bld' --------------------
10/21/2010 9:08:09 AM: Building project step 2 - Telnet...
Connecting to SSH server 'xxxxxxx.com' on port 22
Host key fingerprint: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

<= Received from server:
Last login: Wed Oct 13 12:27:59 2010 from 99.999.999.9
...
Erase set to backspace.
11:08AM up 17 days, 17:10, 1 user, load averages: 0.31, 0.33, 0.31
xxxxx@yyyy%

=> Sending to server:
dir

<= Received from server:
total 428
...
xxxxx@yyyy%

=> Sending to server:
echo test > xyz.txt

<= Received from server:
xxxxx@yyyy%

=> Sending to server:
dir

<= Received from server:
total 432
...
-rw-r--r-- 1 xxxx users 5 Oct 21 11:08 xyz.txt
xxxxx@yyyy%

=> Sending to server:
rm xyz.txt

<= Received from server:
xxxxx@yyyy%

=> Sending to server:
dir

<= Received from server:
total 428
...
xxxxx@yyyy%
Script successfully executed


http://www.kinook.com/Forum/showthread.php?threadid=3044

nasa_d
10-22-2010, 03:00 AM
Thanks for the reply! I tried the shell script working after installing all the options.

But with respect to the response, I do not see the build handles very well. I need to handle the response in two scenarios.

1. To store the response in the macro
2. How to ignore or handle large chunck of response?

Thanks

kinook
10-22-2010, 09:33 AM
The response will be available in the LASTSTEP_OUTPUT macro after the step completes.
http://www.kinook.com/VisBuildPro/Manual/systemmacros.htm

You can use the Read File action or script code to parse or filter the response contents.
http://www.kinook.com/VisBuildPro/Manual/readfileaction.htm
http://www.kinook.com/VisBuildPro/Manual/script.htm

For complex scripts, it may be preferable to create a bash script and call that from the Telnet action rather than calling individual commands directly.