There are four production portal servers. I need to check the logs in each, which means opening a putty session, logging in, running a grep on SystemOut.log. I wanted to be able to automate this.
I found a tool called AutoHotkey. This has quite a rich scripting language. I setup the following to prompt the user for the login password, login to each portal server and run a grep on the log.
----------------------
WinWait, Program Manager,
IfWinNotActive, Program Manager, , WinActivate, Program Manager,
WinWaitActive, Program Manager,
InputBox, PASSWORD, ,Enter the password, HIDE
Sleep, 100
Run "C:\Program Files\putty\putty.exe"
Sleep, 100
Send, portalserver1.org.nz{ENTER}
Sleep, 500
Send, wsadmin{ENTER}
Sleep, 500
Send, %PASSWORD%{ENTER}
Sleep, 500
Send, grep "status :" logs/SystemOut.log{ENTER}
Sleep, 100
Run "C:\Program Files\putty\putty.exe"
Sleep, 100
Send, portalserver2.org.nz{ENTER}
Sleep, 500
Send, wsadmin{ENTER}
Sleep, 500
Send, %PASSWORD%{ENTER}
Sleep, 500
Send, grep "status :" logs/SystemOut.log{ENTER}
Sleep, 100
Run "C:\Program Files\putty\putty.exe"
Sleep, 100
Send, portalserver3.org.nz{ENTER}
Sleep, 500
Send, wsadmin{ENTER}
Sleep, 500
Send, %PASSWORD%{ENTER}
Sleep, 500
Send, grep "status :" logs/SystemOut.log{ENTER}
Sleep, 100
Run "C:\Program Files\putty\putty.exe"
Sleep, 100
Send, portalserver4.org.nz{ENTER}
Sleep, 500
Send, wsadmin{ENTER}
Sleep, 500
Send, %PASSWORD%{ENTER}
Sleep, 500
Send, grep "status :" logs/SystemOut.log{ENTER}
Sleep, 100