5 Replies Latest reply on Jun 5, 2015 11:55 AM by Bill Robinson

    BSA Smart Group base on the installed software at the server?

    Jaakko Lehtinen

      Hi all,

       

      We're running BSA 8.5 and I thought that, sometimes it would be nice to have a smart group of servers, where certain software is installed? So now I'm thinking that, can this be done in a way, where I would have a property 'SoftwareX Installed' at the server object and that would be populated with USP job? Is there a way to do this in BSA and better yet, has someone done this and how? Thanks in advance from your input/help!

        • 1. Re: BSA Smart Group base on the installed software at the server?

          Jaako,

           

          We recently ran through a similar use case with another customer. Our approach was to write a quick NSH script to pull the software information and push the result into a server property. In the following example I'm pulling two properties, the first is any installed packages matching "WebSphere MQ", the result is pushed into the Server property "MQVERSION". And in the second example, parsing through a WebSphere WAS.product flat file to extract the actual installed version.

           

          #!/bin/nsh

          server=$1

           

          MQVERSION=$(blquery $server -e 'package_record_count("printf(\"%s,%s,%s,%s\n\", NAME, VERSION, VENDOR, show_date(DATE, \"%d %m %Y\"))");' | grep "WebSphere MQ")

          blcli Server setPropertyValueByName $server MQVERSION "$MQVERSION"

           

          WAS_VERSION=$(cat /F/WAS8/properties/version/WAS.product | sed -n -e 's/.*<version>\(.*\)<\/version>.*/\1/p')

          blcli Server setPropertyValueByName $server WAS_VERSION "$WAS_VERSION"

           

          Smart Groups were then created accordingly:

          WebSphere-SmartGroupCreation.jpg

          WebSphere-SmartGroup.jpg

           

          Hope this helps,

          Dan

          • 2. Re: BSA Smart Group base on the installed software at the server?
            Bill Robinson

            i posted this somewhere else:

             

            - create a component template that has discovery condtions to find whatever you are looking for

            - run discovery - this creates a component for the server for that template (application)

            - create a server smart group based on the TEMPLATE* property

            • 3. Re: BSA Smart Group base on the installed software at the server?
              Jaakko Lehtinen

              Hi Dan & Bill,

               

              Thank you for your comment and instructions provided. As I'm beginner with BSA, now I atleas know that it's doable. And also have couple ways of doing this, so I can start testing which method suits our needs better.

              • 4. Re: BSA Smart Group base on the installed software at the server?
                Mike Reider

                There is a problem w this appraoch because it doesnt get you correct results. Lets say you have some Win application installed, Notepad++

                 

                your discovery job will create a component and your smart group will show that host because the component exists. If you go and uninstall Notepad++, your component still exists in Blade, even if you run discovery job 2nd time, and your smart group will show the host as still having it installed. Running discovery 2nd time does not delete its component nor update it, so the information becomes outdated. ( I tested and verified this)

                 

                one option is to use NSH script to delete all components for that Template prior to running Discovery again, but this becomes messy. Also you need to schedule this whole thing to run at some intervals to get freshest "installed apps" data, otherwise your smart groups will show outdated information

                • 5. Re: BSA Smart Group base on the installed software at the server?
                  Bill Robinson

                  Yes – that could be a problem.  you could create a smart group of invalid components for the template and then write a script to periodically delete those components.