19 Replies Latest reply on Jul 17, 2007 10:31 AM by chris.lapoint

    Automate Config Downloader in v9

      I know v9 is relatively new, but has anyone automated config downloader yet? I have a VBscript written by Don Yonce/SolarWinds back in 2000 that worked with v8, but not v9.

      We backup weekly all of our Cisco configs offsite and we used the VBscript to automate the process. 

      Any help would be greatly appreciated, and I can provide the script if requested. 

        • Re: Automate Config Downloader in v9

          I'm using version 8 can you share the script?

            • Re: Automate Config Downloader in v9

              Sure, copy script below to a text file and give it a .vbs extension.

               ============================================

              '
              '    Example showing how to download many config files from many Cisco devices at one time
              '
              '    Version 1.0    1-5-2000            Don Yonce
              '    Development@SolarWinds.Net
              '
              Option Explicit

                  Dim TransferEngine
                  Dim Transfer

                  Dim TFTPRootDir        
                  Dim Success

                  TFTPRootDir = "C:\tftp-root"    ' Root Directory of TFTP Server

                  
                  On Error Resume Next
                  Err.Clear
                  '
                  ' Connect to the SolarWinds Config Transfer Engine
                  Set TransferEngine = CreateObject("SWCiscoTransfer.Application")

                  If Err <> 0 Then
                      Wscript.Echo "Cannot start SolarWinds Config Transfer Engine." & vbCrLf & _
                          Err.Description
                  Else
                  '
                  ' Set the TFTP Root Directory
                  TransferEngine.TFTPRootDir = TFTPRootDir

                  ' Download configs from devices
                
                  ' Format: Download,  device IP,  SNMP RW string, Device Name

                  Download "172.16.0.1","private"        ' CORE-ROUTER
                  Download "172.16.0.2","private"        ' CORE-SWITCH

                  Wscript.Echo Success
                  End If
                  Set TransferEngine = Nothing
                  

              Sub Download(IP,Community)
                  ' Create a new transfer object
                  Set Transfer = TransferEngine.Transfers.NewTransfer

                  ' Set IP address and Community string
                  Transfer.IP = IP
                  Transfer.Community = Community

                  ' Download config
                  If Transfer.DownloadConfig then
                  Success = Success & "Success:Downloaded Config to " & Transfer.FullPathname & vbcrlf
                  Else
                  Success = Success & "Error  :" & Transfer.LastError & vbcrlf
                  End If
                  Set Transfer = Nothing
              End Sub

                • Re: Automate Config Downloader in v9
                  mobius

                  This script will still work all you need to do is register this file "Config-Transfer.exe" here is the command

                  Config-Transfer.exe /regserver

                   

                  Mobius 

                  • Re: Automate Config Downloader in v9

                    Thanks Alot... Worked Great...

                      • Re: Automate Config Downloader in v9

                        There seems to be a bug in this since the version change. It uses the last tftp path used and ignores the tftprootdir variable. My example is that I have a path that I use to archive configs d:\configs and I specify this as the tftprootdir in the vbscript. I open tftp and work with some configs that I download/upload to d:\work using the tftp service. When I run the script all my configs get downloaded to d:\work.


                         Hope thats not too confusing.


                        Brian 

                          • Re: Automate Config Downloader in v9
                            chris.lapoint

                            Hi Brian,

                            Can you provide the exact steps to reproduce and expected behavior so we can open a defect for you?

                            For example, something like this...  

                            1) Open Cisco Config Downloader for Toolset [specify version number] and set TFTP Root Directory to "d:\work"

                            2) Run script to archive configs with TFTP Root Directory set to "d:\configs" 

                            3) Configs are downloaded to "d:\work"

                            Expected behavior:  Configs should be downloaded to "d:\configs"

                              • Re: Automate Config Downloader in v9

                                That is exactly what's happening using v9. We have modified the script a bit to change the path daily and to create a log file but it was working until the upgrade. Here's a sanitized copy of the script, just replace xxx.xxx with valid ip addresses and the correct snmp community string.


                                 '
                                '
                                ' Example showing how to download many config files from many Cisco devices at one time
                                '
                                ' Version 1.0 1-5-2000   Don Yonce
                                Development@SolarWinds.Net
                                '
                                Option Explicit


                                    Dim TransferEngine
                                    Dim Transfer


                                    Dim TFTPRootDir  
                                    Dim Success  'Used to for download return value
                                    Dim fso   'Log file
                                    DIm objLogFile
                                    Dim fsoFolder
                                    Dim fsoObject
                                    Dim strFolder
                                   
                                    'Needed to kill processes
                                    Dim objeWMIService
                                    Dim strComputer
                                    Dim objProcess
                                    Dim colProcessList
                                   
                                     TFTPRootDir = "P:\ROUTER CONFIGS\" ' Root Directory of TFTP Server
                                   
                                    'Set FolderName
                                 strFolder= DatePart("d",Now())& MonthName(Datepart("m", Now()),True) & Right(DatePart("yyyy", Now()),2)


                                 'Create Folder
                                 Set fsoFolder = CreateObject("Scripting.FileSystemObject")
                                 fsoFolder.CreateFolder(TFTPRootDir & "\" & strFolder)
                                 Set fsoFolder = Nothing
                                 
                                 'set the new TFTPRoot
                                 TFTPRootDir= TFTPRootDir & strFolder & "\" 
                                 
                                 'Setup for writing to Log File
                                 Set fso = CreateObject("Scripting.FileSystemObject")
                                 set objLogFile = fso.CreateTextFile(TFTPRootDir & "DownloadLog.txt",True)
                                 
                                    On Error Resume Next
                                    Err.Clear
                                    '
                                    ' Connect to the SolarWinds Config Transfer Engine
                                    Set TransferEngine = CreateObject("SWCiscoTransfer.Application")


                                    If Err <> 0 Then
                                        Wscript.Echo "Cannot start SolarWinds Config Transfer Engine." & vbCrLf & _
                                            Err.Description
                                    Else
                                 '
                                 ' Set the TFTP Root Directory
                                 TransferEngine.TFTPRootDir = TFTPRootDir


                                 ' Download configs from devices
                                 Download "xxx.xxx.10.1","private"
                                 Download "xxx.xxx.10.52","private"
                                 Download "xxx.xxx.12.1","private"
                                 Download "xxx.xxx.15.1","private"
                                 Download "xxx.xxx.16.1","private"
                                 Download "xxx.xxx.17.1","private"
                                 Download "xxx.xxx.18.1","private"
                                 Download "xxx.xxx.19.1","private"
                                 Download "xxx.xxx.21.1","private"
                                 Download "xxx.xxx.22.1","private"
                                 Download "xxx.xxx.23.1","private"
                                 Download "xxx.xxx.24.1","private"
                                 Download "xxx.xxx.1.1","private"
                                 Download "xxx.xxx.2.1","private"
                                 Download "xxx.xxx.3.1","private"
                                 Download "xxx.xxx.4.1","private"
                                 Download "xxx.xxx.5.1","private"
                                 Download "xxx.xxx.6.1","private"
                                 Download "xxx.xxx.7.1","private"
                                 Download "xxx.xxx.8.1","private"
                                 Download "xxx.xxx.9.1","private"
                                 Download "xxx.xxx.10.1","private"
                                 Download "xxx.xxx.11.1","private"
                                 Download "xxx.xxx.12.1","private"
                                 Download "xxx.xxx.13.1","private"
                                 Download "xxx.xxx.14.1","private"
                                 Download "xxx.xxx.15.1","private"
                                 Download "xxx.xxx.16.1","private"
                                 Download "xxx.xxx.32.1","private"
                                 Download "xxx.xxx.35.1","private"
                                 Download "xxx.xxx.36.1","private"
                                 Download "xxx.xxx.37.1","private"
                                 Download "xxx.xxx.38.1","private"
                                 Download "xxx.xxx.39.1","private"
                                 Download "xxx.xxx.42.1","private"
                                 Download "xxx.xxx.43.1","private"
                                 Download "xxx.xxx.44.1","private"
                                 Download "xxx.xxx.45.1","private"
                                 Download "xxx.xxx.0.1","private"
                                 Download "xxx.xxx.0.6","private"
                                 Download "xxx.xxx.0.2","private"
                                 Download "xxx.xxx.1.2","private"
                                 



                                    End If
                                    Set TransferEngine = Nothing
                                    Set objLogFile = Nothing
                                   


                                    'Stop the tftp server spawned process
                                    strComputer = "."
                                 Set objWMIService = GetObject("winmgmts:" _
                                     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")


                                 Set colProcessList = objWMIService.ExecQuery _
                                     ("Select * from Win32_Process Where Name = 'TFTP-S~1.exe'")


                                 For Each objProcess in colProcessList
                                     objProcess.Terminate()
                                 Next



                                Sub Download(IP,Community)
                                    ' Create a new transfer object
                                    Set Transfer = TransferEngine.Transfers.NewTransfer


                                    ' Set IP address and Community string
                                    Transfer.IP = IP
                                    Transfer.Community = Community


                                    ' Download config
                                    If Transfer.DownloadConfig then
                                 Success = Transfer.IP & " Success: Downloaded Config to " & Transfer.FullPathname
                                    Else
                                 Success = Transfer.IP & "Error: " & Transfer.LastError
                                    End If


                                    Set Transfer = Nothing
                                   
                                    'Write Log File
                                 objLogFile.WriteLine Success


                                 success = ""
                                 
                                 
                                    
                                End Sub


                                `

                                  • Re: Automate Config Downloader in v9

                                    Another feature enhancement would be if the tftp server could use a unc path instead of a drive letter. As it is, this makes it very difficult to run under a service account instead of a user account.

                                    • Re: Automate Config Downloader in v9
                                      rolson
                                      We are doing something similar. We started by downloading the DownloadConfig script from the unsupported tools sections of the SolarWinds web site. We modified the script to do what we needed done and have been using it for a while now(2-3 years) to automate saving our network device configurations. After installing version 9, the script quite working as expected. The downloaded configs were now going to the C:\TFTP-Root directory instead of the directory that was loaded in the  TFTPRootDir property.
                          • Re: Automate Config Downloader in v9
                            SW4141

                            The following is the responce that I was given by support when asking about the script no longer working.


                            I have submitted a request to our development team to restore the variable directory functionality of our TFTP server in a future release.

                            The original .vbs script provided by SolarWinds is no longer supported and has been superseded by our Cirrus Configuration Manager product. A evaluation of this product is available here:

                            http://www.solarwinds.net/downloads/index.aspx


                            Basically  - because you had a functioning work around that is now a feature in application that we sell, the work around has been disabled and you must purchase the new application to get the feature that was working!  SO, my comment to this is we need to watch out for any other work arounds, as they may also become Features of new products.

                              • Re: Automate Config Downloader in v9
                                chris.lapoint

                                We have been listening to your feedback and we appreciate that many of you have made use of the script (in lieu of Cirrus availability) and it has become critical to your daily operations.  We are planning on addressing the ability to specify TFTP root directory via script in the 9.1 release (this quarter), so please stay tuned!  We appreciate your patience.

                                That said, I just want to clarify that the original .vbs script was provided as-is with no warranties to support moving forward.  Our support team was correct in suggesting that Cirrus Configuration Manager is really the right product and worth considering for your automated configuration management needs...especially as your configuration management requirements expand beyond just Cisco devices and/or necessitate additional compliance steps.

                                • Re: Automate Config Downloader in v9

                                  This was the same response I got after having a ticket open for 2 months. Basically it's BS, this wasn't a workaround, this was a standard function of config-transfer.exe. It was a way to programatically change the destination of the tftp server. Even now if you open config-transfer.exe which is a part of V9 and attempt to change the tftp via the supplied gui interface you get the same behavior. It will not use the directory that you put in, it will copy it to the last directory you configured the tftp server to use.


                                   Another "undocumented feature" is now the tftp server doesn't support a mapped drive as a destination for tftp files when using Cisco Config Viewer or upload/download.


                                   I thought the whole point to an "upgrade" was to add new functionality and feature not take away.


                                   Is there a way I can "upgrade" to version 8?


                                    • Re: Automate Config Downloader in v9
                                      chris.lapoint

                                      I guess we were both working on the same post just a few minutes apart.  Please see my response above.   We'll try to reproduce the issues you described above.  If you discover any other areas where we have inadvertently removed functionality that existed in v8, please open a support ticket so we can track and fix this in the next release.