Help with AutoResponder Script
Hi. I'm trying to use an AutoResponder script for reverse telnet console connections. I'm not a programmer, just a network engineer. I used the sample script that came with the software.
Scenario: I reverse telnet to a device from a Cisco IOS terminal server in order to gain console access. First, I am prompted for the user/pass of the terminal server. Next, I am prompted for the user/pass of the console device. Sometimes I get an "unprivileged" prompt such as "hostname>", in which case I want to type "enable", then the enable password. Sometimes, there is no device connected to the console cable and the session hangs after the initial authentication. In that case, when the cursor doesn't move for 3 seconds, I want to send the abort sequence "CTRL+SHIFT+6", "X". I also want the script to exit in such a case. Here is my script, which I have tweaked many times with no success. Right now, it won't send the abort sequence if the session hangs. I welcome your thoughts and ideas.
#$language = "VBScript"
#$interface = "1.0"
g_vWaitFors = Array("username:", _
g_vRespondWiths = Array("username", _
Set objTab = crt.GetScriptTab
bCursorMoved = crt.Screen.WaitForCursor(3)
If objTab.Session.Connected <> True then
"Error." & vbcrlf & _
"This script was designed to be launched after a valid " & _
"connection is established." & vbcrlf & vbcrlf & _
"Please connect to a remote machine before running this script."
If bCursorMoved = True then
Loop Until bCursorMoved = False
objTab.Screen.Synchronous = true
nIndex = objTab.Screen.WaitForStrings(g_vWaitFors)
objTab.Screen.Send g_vRespondWiths(nIndex - 1) & vbcr
crt.Screen.Send chr(30) & "x"
crt.Screen.Send "disc" & chr(13)
I don't know that using that particular example script is the best option for your usage. It would help me better understand the requirements if you could provide a log file demonstrating you accomplishing this manually. We prefer to keep logs out of the forums to reduce the risk of accidentally exposing sensitive data. Could you take the below steps to generate a log and email it to Support@VanDyke.com with "Attn: Eric forum post 12704" in the subject.
|Display Modes||Rate This Thread|