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.
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:
Hope this helps,
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
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.
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
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.