VanDyke Software Forums

Go Back   VanDyke Software Forums > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-11-2010, 01:26 PM
alaskayz426f alaskayz426f is offline
Registered User
 
Join Date: Jan 2010
Posts: 2
Question Append numerous log files to one log file

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
Reply With Quote
  #2  
Old 03-11-2010, 02:48 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 925
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?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 03-11-2010, 03:21 PM
alaskayz426f alaskayz426f is offline
Registered User
 
Join Date: Jan 2010
Posts: 2
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
Reply With Quote
  #4  
Old 03-12-2010, 06:11 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 925
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?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 03:42 PM.


© copyright 1995-2010 VanDyke Software, Inc.