#46
|
|||
|
|||
Hi stuartX,
I reviewed the phone notes and prior forum posts you had with Todd and it seems you are using an older version of SecureCRT, while all our tests have been with the current release. Based on the serial number provided, you should be eligible to upgrade to the current release, version 6.7.4. We would like you to do that before we go too much further. For one thing, v6.0.x always reported script errors "one line off" and that is counter-productive to resolving problems that occur when running the script. You can check your upgrade eligibility here. Also, do you connect to any of these devices with anything but Telnet protocol?
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#47
|
|||
|
|||
I now have version 6.7.4 and it doing the same thing.
stuart |
#48
|
|||
|
|||
Hello stuartX,
No worries. We did not expect it to resolve the issue, it's just a good idea to be running the current release if possible. ![]() You overlooked one question: Quote:
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#49
|
|||
|
|||
No problem, its good to be up on the current version.
Telnet is the only protocol used to access the devices. |
#50
|
|||
|
|||
Hi stuartX,
The revised script is below. Code:
# $language = "VBScript" # $interface = "1.0" Sub Main strUsername = "user" 'not real username strPassword = "password" 'not real password strPrompt = "#" Set fso = CreateObject("Scripting.FileSystemObject") strDeviceList = "s:\riggs\Test-router-1.txt" Set fil = fso.OpenTextFile(strDeviceList) ' Start loop to iterate over all devices defined in file While Not fil.AtEndOfStream ' Process a line at a time vLine = Split(fil.ReadLine, ";") strHostname = vLine(0) strIP = vLine(1) On Error Resume Next crt.Session.Connect cnxnString strErr = Err.Description nError = Err.Number On Error Goto 0 If crt.Session.Connected = False Then crt.Dialog.MessageBox "The following host cannot be reached: " &_ vbcrlf & vbtab & strHostname & vbcrlf & vbcrlf &_ "With error: " & vbcrlf & vbtab & strErr Else ' Enable Synchronous which is necessary to avoid missing data from ' remote crt.Screen.Synchronous = True crt.Screen.WaitForString "login:" crt.Screen.Send strUsername & vbcr crt.Screen.WaitForString "Password:" crt.Screen.Send strPassword & vbcr ' Confirm that remote is ready crt.Screen.WaitForString strPrompt ' Start logging to new file strLogFile = "S:\Riggs\" & strHostname & "-%Y-%M-%D--%h-%m-%s.%t.txt" crt.Session.LogFileName = strLogFile crt.Session.Log True ' Turn off paging crt.Screen.Send "term length 0" & vbcr crt.Screen.WaitForString strPrompt ' Send commands crt.Screen.Send "show proc cpu | inc CPU" & vbcr crt.Screen.WaitForString strPrompt crt.Screen.Send "show version" & vbcr crt.Screen.WaitForString strPrompt ' Stop logging crt.Session.Log False ' Disconnect from device If crt.Session.Connected Then crt.Session.Disconnect End If End If Wend ' Close device file fil.Close End Sub To create a raw log:
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
#51
|
|||
|
|||
@Brenda,
SSSwwwweeeettt!!!! That works consistently. Thank you very, very much. @RTB, Thanks for all your help. Stuart |
#52
|
|||
|
|||
@Stuart,
Thhaaaannnkkkksss!! I am glad to hear the script is working for you. I will pass along your message to Todd. ![]()
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|