4 Replies Latest reply on Jul 11, 2014 10:09 AM by Nick Chard

    Edit config files

      I am trying to create a Component Template that will allow me to find and make changes to one or more config files on our servers.


      I have created the Component Template, and have a some questions about deploying changes to the config file.


      1. I've created two Local Properties, Path and ConfigFile, which are combined together to form the Part of the Component Template, which is Path/ConfigFile. I have then created some instances of Path and ConfigFile, which when combined will form the path the the config files I am interested in. However, I can't find any way of using these instances. If I create a component I can see Path and ConfigFile listed as available properties, and I can manually type in a Path and ConfigFile, but I want to be able to select values that are already created (eg. my instances).

      2. If my Part is of type Configuration File, I can manually specify entries for Path and Config file, then I can create a Component and view the config file in that Component. If the Part type is File, then Component is empty when it is created, a file exists at the specified location so why is the component empty?

      3. Once my Component is created, I can view all the configuration elements within it. I want to be able to add, remove or edit any part of this configuration file. Editing seems fairly straightforward, I can create a package from the element I want to change and easily edit and then deploy it. I can't find any way to add to this file within the package. I've tried creating a package from the whole configuration file, but cannot see a way to add to it when I view the package. Is there a way to do this? or am I going about it the wrong way?

        • 1. Re: Edit config files
          Joe Piotrowski

          It sounds, on the surface, as though you are trying to combine two separate parts.


          Can you take a step back and explain what your requirement is, rather than how you're attempting to do it in BSA? That way someone can tell you the best way to accomplish it in BSA.


          For example: I'm using BSA version X, we have a config file used for X, this config file can exist in different directories, we need to do compliance on this config file looking for X, etc.

          • 2. Re: Edit config files

            Ok. This is what I am trying to achieve.


            I have a number of web servers each one running a number of web services. Each web service has a web.config file. At the moment, if anyone wants to make a change to the web.config file they log on to the server, take a backup of the file, then make their changes by editing the file in Notepad.

            I want to change this process, so anyone who edits a config file does it through BladeLogic (we're using Server Automation v8.3).

            Each server contains a large number of web.config files, all in different locations. I want to create a simple process to add, remove or edit content in any config file. Something that allows me to easily see what has been changed and when, and to roll it back if necessary.

            • 3. Re: Edit config files
              Bill Robinson

              in order to rollback, you need to have a snapshot, or you need to use a blpackage to deploy the change(s).  otherwise there is no way to rollback after a change.


              https://docs.bmc.com/docs/display/bsa83/How+to+pass+local+parameter+values+to+a+compliance+remediation+package has some examples of setting up the PSIs and parts.


              so you have your two properties.  you create the local parameter instances for each possible value of your path, and then setup discovery to look for /??BLAH??/??FOO?? or whatever the path will be.


              from there you can snapshot all of those components and then allow access for manual edits, or you can allow the users to deploy via the blpackage/bldeploy.


              i'd also ask why do the users need to manually edit these files? 

              • 4. Re: Edit config files

                Thanks Bill, that link provided me with the information I needed. I wasn't creating the instance of my local property correctly on the component template. Once I resolve this I was able to make a component and create a package for any changes that were needed