Sign in to follow this  
Followers 0
Guest pragathi

Automate Telnet Sessions

15 posts in this topic

I am trying to automate a telnet session using AutoIt. To verify the return values from remote servers, I need to read text output from telnet window. "AutoIt window spy" cannot read text inside the telnet windows. Is there a way to read telnet output ?

Tks....

Share this post


Link to post
Share on other sites



I am trying to automate a telnet session using AutoIt. To verify the return values from remote servers, I need to read text output from telnet window. "AutoIt window spy" cannot read text inside the telnet windows. Is there a way to read telnet output ?

Tks....

<{POST_SNAPBACK}>

Hi Andre

Thanks for quick response ..!! Tried with Putty and CRT but still cannot read text. "Visible Text" and "Hidden Text" both are empty in window spy. Is there any configuration setting to enable this ?

Share this post


Link to post
Share on other sites

Hi,

I did not try Putty myself with the spy. When u get no text with it search for an Telnet client that works ?

Andre


What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!

Share this post


Link to post
Share on other sites

Hi,

I found the best way is to use TeraTermPro (it's free) for automating telnet sessions, it has a nice little macro facility that I also use to combat the auto time out of some devices, i.e auto re-logs in. You do have to setup the Macro file type registration yourself but its straight forward and instructions are included, then you have a "one click" telnet login.

You can get it from ;

http://www.vector.co.jp/authors/VA002416/teraterm.html

When it comes to SSH I use OpenSSH combined with AutoIt scripts, works a treat !

If you want me to post a TTP Macro example let me know.

Good Luck

:ph34r:


Life is like a box of chocolates, the wifes already had the good bits ;-)

Share this post


Link to post
Share on other sites

Hi,

I found the best way is to use TeraTermPro (it's free) for automating telnet sessions, it has a nice little macro facility that I also use to combat the auto time out of some devices, i.e auto re-logs in. You do have to setup the Macro file type registration yourself but its straight forward and instructions are included, then you have a "one click" telnet login.

You can get it from ;

http://www.vector.co.jp/authors/VA002416/teraterm.html

When it comes to SSH I use OpenSSH combined with AutoIt scripts, works a treat !

If you want me to post a TTP Macro example let me know.

Good Luck

:ph34r:

<{POST_SNAPBACK}>

Thank you very much all you guys for your support & help !!! This is the first time I posted to this forum & response is really impressive, appreciate your work.

I will work with these information and let you know the progress....

Best regards !

Share this post


Link to post
Share on other sites

Thank you very much all you guys for your support & help !!! This is the first time I posted to this forum & response is really impressive, appreciate your work.

I will work with these information and let you know the progress....

Best regards !

<{POST_SNAPBACK}>

Hi Morgion,

Thank you very much !. I was able to fulfill my requirement using Term tera. It is working nicely and exactly the way I wanted !!!!

Warm regards !! :ph34r:

Share this post


Link to post
Share on other sites

Hi Morgion,

Thank you very much !. I was able to fulfill my requirement using Term tera. It is working nicely and exactly the way I wanted !!!!

Warm regards !! :ph34r:

<{POST_SNAPBACK}>

Hi there. I wanted to perform something like you want also.

I have downloaded the Term Tera program, and it works as what I

wanted, where the telnet session output to a file.

However, in Term Tera program, how can we set it to have a output of

the telnet session before we telnet to a server ?

As I tried, we can Log the telnet session only after we click the "Log..."

thing. Can we make it permanent where it will create a log file whenever

we telnet a server ?

Please help... I'm totally new to Term Tera thing

Share this post


Link to post
Share on other sites

Another question, how can we get text from command line windows?

Share this post


Link to post
Share on other sites

I cut my macroing teeth on Telnet scripts 10 years ago. Made some very big ones (24,000 ISDN router networks - for big number change was a nice one!)..

Anyway, my favorate RAD tool was Reflections 7 which is a fully VBA supported telnet engine - it is not cheap though.

An application I wrote for a bank to manager thier e-commerce network recently relied on pure java for its operation (I did not wrtie the java), but the method was socket stream capture.

I dont know to what level you are, but basically a nice fat client that allows copy screen sections to clipboard as text is what you want.

If you can do it manually with an aplication, you can automate it.

Share this post


Link to post
Share on other sites

Hi Morgion,

Thank you very much !. I was able to fulfill my requirement using Term tera. It is working nicely and exactly the way I wanted !!!!

Warm regards !! :ph34r:

<{POST_SNAPBACK}>

Glad I could help :(

Life is like a box of chocolates, the wifes already had the good bits ;-)

Share this post


Link to post
Share on other sites

Hi there. I wanted to perform something like you want also.

I have downloaded the Term Tera program, and it works as what I

wanted, where the telnet session output to a file.

However, in Term Tera program, how can we set it to have a output of

the telnet session before we telnet to a server ?

As I tried, we can Log the telnet session only after we click the "Log..."

thing. Can we make it permanent where it will create a log file whenever

we telnet a server ?

Please help... I'm totally new to Term Tera thing

<{POST_SNAPBACK}>

This isn't something I've needed to use but there are two approaches to this;

1) You can start TTPro with a command line switch (and therefore shortcut)

ttermpro 1.1.1.1 /L=fred.log

or

2) There is a macro command ;

logopen <filename> <binary flag> <append flag>

If you look in the directory where TTPro is installed you'll find a macro.hlp file, there's also a Japanese version macroj.hlp :(

Have a look at the TTL command reference, this may be a better solution if you need/want a different log for each connection.

As for the log location, I couldn't get it to work with a full path name but I didn't try for long. It created the log in the same dir as TTPro for me but I haven't spent much time on it. Have a play, see what you can do.

Good luck

:ph34r:


Life is like a box of chocolates, the wifes already had the good bits ;-)

Share this post


Link to post
Share on other sites

Another question, how can we get text from command line windows?

<{POST_SNAPBACK}>

In the TTPro dir there is a file called TERATERM.INI

In that file look for :

; Auto text copying

AutoTextCopy=on

If it's set to "off" change it to "on" then save it.

With this option turned on clicking the left mouse and draging over any text will automatically copy it to your clipboard.

If you have something in the clipboard you want to past into a TTPro window just right click in the window.

If you have a large amount of text you wish to copy then just increase the size of your TTPro scroll buffer:: setup --> window -->scroll buffer xxxx lines

or in TERATERM.INI --> ScrollBuffSize=xxxx (I have mine set to 2000 which is adequate for things like switch/load balancer config's)

Have fun :ph34r:


Life is like a box of chocolates, the wifes already had the good bits ;-)

Share this post


Link to post
Share on other sites

I cut my macroing teeth on Telnet scripts 10 years ago.  Made some very big ones (24,000 ISDN router networks - for big number change was a nice one!)..

Anyway, my favorate RAD tool was Reflections 7 which is a fully VBA supported telnet engine - it is not cheap though.

An application I wrote for a bank to manager thier e-commerce network recently relied on pure java for its operation (I did not wrtie the java), but the method was socket stream capture.

I dont know to what level you are, but basically a nice fat client that allows copy screen sections to clipboard as text is what you want. 

If you can do it manually with an aplication, you can automate it.

<{POST_SNAPBACK}>

Hi macrowriter,

I don't claim to be a pro in this field, I just use TTP to make life a bit easier in my day to day work, there's only so many times you want to type the same telnet command :ph34r: (I also find the windows client rather nasty)

I'd be interested to see what you think of TTP, to my untrained eye it's seems very flexible.

Go on, give it a try, you know you want to. :(


Life is like a box of chocolates, the wifes already had the good bits ;-)

Share this post


Link to post
Share on other sites

I cut my macroing teeth on Telnet scripts 10 years ago.  Made some very big ones (24,000 ISDN router networks - for big number change was a nice one!)..

Anyway, my favorate RAD tool was Reflections 7 which is a fully VBA supported telnet engine - it is not cheap though.

An application I wrote for a bank to manager thier e-commerce network recently relied on pure java for its operation (I did not wrtie the java), but the method was socket stream capture.

I dont know to what level you are, but basically a nice fat client that allows copy screen sections to clipboard as text is what you want. 

If you can do it manually with an aplication, you can automate it.

<{POST_SNAPBACK}>

Like you seems I've been scripting for years.....Reflections has always been a great tool but the cost kept me form putting it on the shelf at home so to that end I searched for something a little closer to what my wife would let me spend, and you know what I mean. :) I found that Secure Koala Term fit the bill nicely. The scripting in it is very close to Autoit as well, has buttons but each of them can be called from the script and to that end the capture text is great. As I recall it's less than $50 and they have a 30 eval. Does telnet, ssh and serial so it I get along very well with it managing the CISCO equipment I maintain. With the capture to a file function, I'd think adding it to Autoit would fill the needs of gathering data from screen for most people. Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0