#1
|
|||
|
|||
![]()
Hello,
I need to automatically log outputs of cisco commands and i am using this commands - #$language = "VBScript" #$interface = "1.0" Sub main logfile = "C:\Documents and Settings\cadisesh\Desktop\sessions\%H=%M-%D-%h-%m-Session.txt" crt.Session.LogFileName = logfile crt.Session.Log True crt.Screen.Send "skip-page-display" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "show run" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "show vlan" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "show span" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "show 8" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send "show log" & VbCr crt.Screen.WaitForString "#" crt.Screen.Send " page-display" & VbCr crt.Screen.WaitForString "#" crt.Session.Log False For some reason afetr this line - crt.Screen.Send "show vlan" & VbCr crt.Screen.WaitForString "#" it does not complete the above line but skips the next command out. Is there anything that can be added here so that it completes the current command of "show VLAN" and then proceed to the next command output. Thanks |
#2
|
||||
|
||||
Hi Coxuser12,
In looking at the script and the description of what is happening, I suspect that there is a "#" in the output of the "show vlan" which is causing the crt.Screen.WaitForString to become true and the script to continue before intended. An option to test and avoid this issue would be to wait for a large portion of the prompt to appear. If a larger portion of the prompt is waited for instead of just "#", does the script correctly wait for the command to finish before moving on? There is also one other option that is missing in the script. This would be to enable crt.screen.synchronous at the beginning of the script. This can be enabled with the following line: crt.screen.synchronous = true This line ensures that data is not missed as it appears on the screen.
__________________
Thanks, Teresa Teresa Nygren Last edited by tnygren; 10-06-2008 at 08:48 AM. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|