Need a terminal application with automatization

Hi.

I need a terminal application with automation.
The automation I need is very simple - it should be able to execute a script like this:

  connect 'MyHost 23'
  settitle 'XXX: Run build...'
  logopen 'd:\build\log\xxx\linux-terminal.log'
  wait   'login:'
  sendln  'builduser'
  wait   'Password:'
  sendln  'pazzword'
  wait   '$ '
  sendln  'cd /home/builduser/sandbox/xxx'
  wait   '$ '
  sendln  'build.sh'

and so on.

Before I have used TeraTermPro - it is very very old program.
It worked fine, but with increasing workload (when computer running more instances of TeraTermPro) it simply hang. Looks like there are some internals conflicts which makes TeraTerm deadly hang, so I have to kill process from TaskMgr and restart it from beginning.

Also I have tried SecureCRT but it has some problems with characters encoding - if I set Encoding=UTF8 the MidnightCommander hang the session. If set Encoding=UTF8 or ASCII MidnightCommander displays lot of trash characters - I do not see the panels content at all.

Also SecureCRT sometimes starts to consume 100% of CPU without any reason.
And another bad thing - it exclusively lock the session log file, so impossible to look on it while it running. :-(((

Can you recommend any other terminal applications that can execute session automation scripts like I mentioned above?
Also very important thing - terminal application should be able to run in unattended mode, without any popup/confirmation windows to user - it should just execute specified script, close session and exit - nothing more. Would be nice if it will not lock log files exclusively.

In my case automation scripts generated by some program using a set of templates, so automation script can not be the same for all cases - all the time it is different. Which means - I need a possibility to specify name of script in a command line for terminal application.

Note: as a terminal I like the Putty application but seems it does not support automation scripts. So I cannot use it in such cases. :-\

Any ideas? Recommendations?
What also terminal applications I can try?

Or maybe - can you recommend any other automation approaches to execute some scripting in terminal on remove UNIX/Linux environment?

Regards,
Dmitry.
Dmitry_BondAsked:
Who is Participating?
 
pwustConnect With a Mentor Commented:
How do you reach the remote servers? By modem or rather by IP or hostname with a port number?
In the latter case there should be easy ways with netcat / nc (www.nmap.org for windows binaries, or if it is Linux maybe some rsh (remote shell) commands, but I didn#t work out anthing yet.
Also a possible try could be any scripting language (Windows Batch, WSH, AutoIT). AutoIT should be possible to user a modem from Windows (or COM-Port) for connecting if needed.
0
 
Dmitry_BondAuthor Commented:
As you can see from terminal script example I provided in original question - there is a "connect MyHost 23" command. So, I'm using combination of IP + port to connect target UNIX environment.

Sorry, I have not mentioned - I need to connect  UNIX/Linux environments from Windows.

Could you please provide some examples how it could be scripted from Windows Batch, WSH, AutoIT?!
0
 
veedarCommented:
There is a popular program called "Expect" that is made for this. It will run from Windows to UNIX

http://expect.nist.gov/
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Dmitry_BondAuthor Commented:
Just looked on Expect. Seems quite inconvenient thing as for me.
In particular:
1) hard to find where to download version for Windows.
2) use some tricky language - TCL/TK.
3) no examples how to reach the mentioned goal.
4) No documentation available - only badly linked pieces of text (from forums or email?)

Hm... feeling like nobody knows this topic here :-\
0
 
pwustConnect With a Mentor Commented:
Please find attached an example how to solve your issue with using PuTTY's telnet function, and AutoIT v3's scripting power, using STDIN and STDOUT redirection.
HTH
telnet-with-putty-generic.au3.txt
0
 
Dmitry_BondAuthor Commented:
Thanks. Interesting method. Perhaps I'll look on AutoIT more precisely.

But anyway I have found another way to do it. And seems it is better than approach with scripts like I used before in TeraTermPro or SecureCrt.

In particular - I have done it by using PLINK.EXE utility which is part of PUTTY application.
See it here - http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

There are number of very simple steps:
1) configure in a Putty the SSH session to target host (let say = "FedoraVm01")
2) generate by Putty tool SSH key (private key file = "id_rsa")
3) create script.txt file with commands to execute remotely (see example of script.txt file enclosed - use 1 empty line after every command)
4) Then run following command:

plink.exe -load FedoraVm01 -l xxxbuild -pw p4zzw0rd -i id_rsa < script.txt > session.log

It will connect, execute commands from a script.txt file and save log in a session.log file.

I already implemented it and tested - working just perfect! :-)
It can run any number of instances, working very fast, do not hang, save all session output in a log file.
Thus, I assume - it is essentially better then TeraTermPro or SecureCRT. At least for my case...
export PS1='\$ '

cd /home/xxxbuild/sandbox/R2007B/xxx/build

dos2unix build.sh

chmod 775 build.sh

./build.sh

logout

Open in new window

0
 
pwustConnect With a Mentor Commented:
ok that works perfectly when connecting by SSH.
 
For telnet access you will need the scripting version provided above, since you need to make it through the auth process using the script.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.