View Single Post
  #2  
Old 12-23-2011, 01:13 PM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,040
Hello KentC,

Most of what you're wanting to do could be done without any scripts. Sending e-mail upon detection of some error condition will require a script.

For security reasons you may not want to embed a username and password in a script. SecureCRT's Session Options / Connection / Logon Actions provides Expect / Send capabilities. Using Expect/Send in Logon Actions allows you to hide the string you're sending (so your password doesn't need to sit in plain text in your script). If username and password are session specific, it makes sense to use Logon Actions for the session logon credentials. If you have the same username and password for all sessions and you don't care about security, it might be alright to leave the username and password in a script.

When learning how to script with SecureCRT, it's a good idea to use the Script Recorder in the Script menu. It will help show the general sequence you should use: WaitForString, Send, WaitForString, Send. Always use WaitForString before Send (whenever you see two back-to-back Sends, you are almost certainly looking at a problem). Failure to WaitForString before issuing Send is by far the most common mistake you'll find discussed in our Scripting forums.

Can you take a look at Logon Actions and see if the Expect/Send strings will be useful for you, at least for automating the logon process?

Next, can you try the Script Recorder and manually walk through the steps you want to take (issue the commands, such as show clock, show call...), and when you're finished running the commands select Script / Stop Recording Script and see how much of the script the Script Recorder can write for you?

In this case, looking for errors and sending e-mail should probably be added later, after you have a functioning script.
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote