View Single Post
  #5  
Old 07-21-2014, 10:28 AM
collinclark collinclark is offline
Registered User
 
Join Date: Nov 2009
Posts: 10
I'm having the same problem (but my script is a little simplier).

# $language = "VBScript"
# $interface = "1.0"

Sub Main

crt.Screen.Synchronous = True

crt.Screen.Send vbCr
crt.Screen.WaitForString "#"

Dim logfile
logfile = "C:\FTP_ROOT\CONFIGS\%S_%H__%M-%D-%Y-%hh.%mm.config.txt"
crt.Session.LogFileName = logfile

crt.Session.Log True

crt.Screen.Send "term len 0" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== CLOCK/TIME ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show clock" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== CONFIGURATION ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show run" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== CHECK VERSION INFO ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show version" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "dir /all" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== HARDWARE LIST ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show inventory" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== VIEW ROUTING ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show ip route" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show run | include ^ip route" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== VIEW INTERFACE STATISTICS ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh ip interface brief" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh interfaces counters errors" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh interfaces accounting" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== CHECK RESOURCES ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show proc cpu history | i [0-9]" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh proc cpu | e 0.00% 0.00% 0.00%" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh processes memory sorted | e 0 0 0" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== VIEW ACCESS LIST HIT COUNTS ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh access-list | i matches" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== VIEW THE LOG ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "show log" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send " !=============== LIST VPN CONNECTIONS ===============@ " & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "sh crypto isa sa" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Send "term len 40" & vbCr
crt.Screen.WaitForString "#"

crt.Session.Log False
crt.Screen.Send vbCr
'crt.Session.Disconnect

End Sub


The logging stops at different places. Any ideas? Thanks.
Reply With Quote