3 Replies Latest reply on Oct 11, 2016 3:22 PM by mesverrum

    Renaming configurations using a script - is it possible?


      Every night we have job running that takes a backup of the running config of all devices if there is changes during the day.

      Now I'm seeking to make a script that runs after the backup job and that automatically renames each config according to some parameters I specify.

      I'm very new to coding in SolarWinds (but not to coding in general!) so I'm not sure how to approach this and what the standard way of doing it is in SolarWinds. I looked in the NCM administration guide and the only things I can find about scripting is to make device specific configurations. This script is more likely to be executed on the SolarWinds server itself as it modifies the content in the local database.

      What kind of script can I use to connect to the SolarWinds database to obtain a list of configurations? C#, PowerShell, VBscript or something else?

      Can someone give an example of how to connect to the SolarWinds database using the configuration from the local SolarWinds installation and fetching all configurations from the last day?

        • Re: Renaming configurations using a script - is it possible?

          In the NCM settings > Configs there is a place where you can already define the folder and naming format you want to use for saved config files.  The configs themselves are copied onto your server in a text file (.config) as they are downloaded so if you wanted to act on those files directly you can do so with any normal batch scripting method for renaming/moving/archiving.  I generally don't find a need to do that because you can typically just adjust the NCM settings to get them saved how/where you want them in the first place.


          You usually don't want to be running many scripts directly mucking about inside the database unless you feel really confident that you know the db well enough not to break anything, and if you are doing any sort of scripting there the it will typically be in the form of setting up SQL tasks, triggers, and stored procs.


          -Marc Netterfield

              Loop1 Systems: SolarWinds Training and Professional Services

            • Re: Renaming configurations using a script - is it possible?

              Thank you for your answer. I can see I need to explain what I want to do a little more

              We are using a change management tool for handling change requests and every time a change request is executed it will generate a number of configuration changes that corresponds to a startup configuration file in NCM. These configuration files are then "tagged" with the change number by append the change number to the end of the configuration title and by putting it in the comment box. This work is done manually.

              Every night the running configuration is then backed up. If more than one change is done to a device during the day, this running config will contain all the changes of the day. The title and comment of the change has to be "tagged" with all the change request numbers of the startup configurations from that date.

              While your solution would be ideal for most people it doesn't really fix my problem.


              And on a side note it would be really helpful if Solar Winds supported "real" tags on configuration changes like you can tag conversations here on this board with certain keywords.