8 Replies Latest reply on Nov 14, 2005 11:47 AM by Bill Robinson

    Smart Server Group based on Component Discovery

      Is it possible to create Smart Server Group based on a Component Discovery Job result. This would be a desirable feature.

        • 1. Re: Smart Server Group based on Component Discovery

          I agree, this would be useful, so you can log an enhancement in trackweb.

           

          However, a few things to note:

           

          1. If you run a component discovery job, in the components tab, you can see all instances of that component. So, for browse purposes, you have your smart group.

           

          For audits and snapshot Jobs, if you base it on components, then when you target say, "All Servers", only the servers on which the component was previoulsy discovered will actually be used for the results.

           

          That leaves doing deploy jobs (not via a sync with master). And here is where it falls short and I agree with you that at this point you would need some kind of smart group.

           

          2. A way to work around this in our current software offering:

          -Write an NSH script job that uses blquery to query server assets to check for the presence of the asset(s) that form the signature of the component.

          -Run it against all servers and when the conditions are met, set a user defined property to 'TRUE' on which you base your smart group.

          • 2. Re: Smart Server Group based on Component Discovery
            Bill Robinson

            if anybody is watching this thread... i want to do what aaron specified, however, blquery is returning some funky output - it returns a "^M" along w/ its output...anyone run into this...and how to get around it?

             

            is there a better way to create a smart server group based on installed software?

            • 3. Re: Smart Server Group based on Component Discovery

              Try getting rid of the ^M's by piping output through a sed.

               

              blah | sed -e s/^M//g

               

              You can't just type ^M though; it's comprised of special character. Type it out as "Ctrl-V" and "Ctrl-M" in succession. Not sure how well this works in a script.

              • 4. Re: Smart Server Group based on Component Discovery
                Sean Berry

                tr -d '[:cntrl:]' is your friend, but beware, it's zealous. Specifying ascii characters might be more productive. Drop me a line if you're still having troubles.

                • 5. Re: Smart Server Group based on Component Discovery

                  What Sean and Jarrod said. I guess I was too late. :)

                   

                  sed 's|<ctrl-v><ctrl-m>||g'

                   

                  This will appear on a command line or in a script as sed 's|^M||g'

                   

                  This is what's you'll need to do if you choose the sed method. The <ctrl-v> escapes the <ctrl-m>. Try it. It will allow you to escape any control characters, not just line feeds.

                   

                  Otherwise, use Sean's approach. I've checked tr on a variety of UNIX systems and all the ones I checked supported using tr with character classes like :cntrl:.

                   

                  -chris

                   

                  Message was edited by:

                  Chris Zappala

                  • 6. Re: Smart Server Group based on Component Discovery
                    Bill Robinson

                    well, the sed/tr works - thx...but i'm still having an issue:

                     

                    WDEL71CGY11U% blquery hafml023 -e 'reg_value_exists ("HKEY_LOCAL_MACHINE
                    Software
                    Microsoft
                    Exchange
                    Setup
                    ProductID")' | tr -d '[:cntrl:]'

                    1WDEL71CGY11U%FOO=`blquery hafml023 -e 'reg_value_exists ("HKEY_LOCAL_MACHINE
                    Software
                    Microsoft
                    Exchange
                    Setup
                    ProductID")' | tr -d '[:cntrl:]'`

                    WDEL71CGY11U% echo $FOO

                    0

                    WDEL71CGY11U%

                     

                    so the FOO=`command` should make FOO equal to the output of the command. or is it just picking up the return value ?

                    • 7. Re: Smart Server Group based on Component Discovery

                      You have to escape the \'s another time when you put it in ``'s.

                       

                      If you look at the agent log that you're connecting against, you'll notice that the wrong command is getting executed.

                       

                      If you do something like:

                       

                      FOO=`blquery hafml023 -e 'reg_value_exists ("HKEY_LOCAL_MACHINE

                      Software

                      Microsoft

                      Exchange

                      Setup

                      ProductID")' | tr -d '[:cntrl:]'`

                       

                      It should work just fine.

                      • 8. Re: Smart Server Group based on Component Discovery
                        Bill Robinson

                        perfect. thx. that's nice - escaping the escaped \'s. how many more times can we escape them? :)