![]() |
|
#1
|
|||
|
|||
|
I am new at scripting.....I have been able to connect to several sites using the "Remote Machines Within a Loop" example and dump the output to a log file........but there are several dozen sites resulting in serveral dozen log files, how can I run my script and append my log files to end up with one log file.
Thanks |
|
#2
|
|||
|
|||
|
Hi alaskayz426f,
I am glad to hear that you are trying out scripting in SecureCRT. I am not familiar with the "Remote Machines Within a Loop" example, so I am not sure how it is coded. Would you be able to post the script you are using, or point me to the example? Are you using sessions to connect to the remote devices? How have you configured the script to log the data? |
|
#3
|
|||
|
|||
|
My script example
Here is a small example of my script..Thanks
#$language = "VBScript" #$interface = "1.0" Dim vHosts(100) vHosts(0) = "10.X.X.X" vHosts(1) = "10.X.X.X" vHosts(2) = "10.X.X.X" For Each strHost In vHosts If strHost = "" Then Exit For crt.Screen.Synchronous = True crt.Session.LogFileName = "c:\morninglog\%S_%H_%M-%D-%Y_%h-%m-%s_morning.txt" crt.Session.Log True crt.Session.Connect "/TELNET " & strHost crt.Screen.WaitForString "login: " crt.Screen.Send "msc" & chr(13) crt.Screen.WaitForString "Password: " crt.Screen.Send "ms c" & chr(13) crt.Screen.WaitForString "> " crt.Screen.Send "cpu_status" & chr(13) crt.Screen.WaitForString "> " crt.Screen.Send "exit" & chr(13) if crt.Session.Connected Then crt.Session.Disconnect Next |
|
#4
|
|||
|
|||
|
Hi alaskayz426f,
Thanks for posting a part of the script. You have configured the log file to have a filename that includes hours, minutes and seconds. If you remove the %m and %s, depending on how long it takes your script to run, you should end up with one file. It may be necessary to remove the %h as well, if your script runs for longer than an hour. Does making this change cause your script to produce only one log file? |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|