3 Replies Latest reply on Nov 9, 2005 7:29 AM by Mark Jeffery

    extending substitution in a component using config files

      I have created a component that contains a single configuration file (in this case it's a weblogic config.xml file). I have a server that has multiple instances of weblogic applications installed in different directory locations and therefore multiple instances of this configuration file. My aim is to be able to snapshot and audit these files (the content of) via a component and the use of server properties for the directory location. This works fine however I need to substitute these properties into values in the config.xml files so I can compare entries in the file like for like regardless of the installation directory values.


      Has anybody tried this or knows if this is possible?? Any help would be appreciated.

        • 1. Re: extending substitution in a component using config files



          We will be able to use properties for values in configuration files in LOTUS (due out Q1 2006). Until then, we can only use properties to define the path to an asset and not its value. For example, we could check the hosts file entry for /etc/inet/hosts//??IP_ADDRESS??, but we could NOT check that /etc/inet/hosts//??IP_ADDRESS?? was equal to ??HOST??. Does that make sense?


          Essentially, you can use properties to define the Template Part.


          Again, full property abstraction will be available in LOTUS. What I'd suggest in the meantime:


          1. Create a template whose parts are all the non-instance-specific values.

          2. Create an extended object that does verification on the instance-specific values. You can pass in those values as arguments to the extended object. Again, back to our /etc/hosts example, something like this:



          Call: //@/usr/nsh/scripts/check_host_entry ??IP_ADDRESS?? ??HOSTS??


          Script (check_host_entry):





          HOST_NAME_IN_FILE=`cat /etc/inet/hosts | egrep ^$

          | awk '${print $2}'`

          if [[ $HOST_NAME_IN_FILE != $HOST_NAME ]]
          print "[/etc/inet/hosts]\n$


          print "[/etc/inet/hosts]\nHost entry=consistent"




          And then use the ini grammar to parse it. Something like that.

          • 2. Re: extending substitution in a component using config files



            Thanks for this I understand what you are saying, will give it a go and see how its works.

            • 3. Re: extending substitution in a component using config files

              Hi Paul,


              This can also be done with components.


              If we assume that your config file is something like




              In Toolbar->Config file admin create a parameterised config file.


              Create your component template.


              When you do the component discovery and have discovered the component corresponding to the current setting of APP_BASE.


              Before you click finish go to the middle pane (containing discovered components), and click the + icon above it.


              This allows you to create a new component on an existing server with a different setting for the APP_BASE property.


              In order to look at both these values, I have found that you need to toggle the APP_BASE property through all settings, and browse the components. It should then work OK.


              Complicated, but it has worked ok for me.




              P.S. Looks like I may have misunderstood your requirements, and that you already have this bit working, and you are having trouble with the next bit.


              Message was edited by:

              Mark Jeffery