4 Replies Latest reply on Apr 5, 2013 3:40 PM by Siddu angadi

    Is there a way to find all servers under a particular group whereas there are multiple groups under the top group

    Q Le

      Say I have the following server group structure

      /SAP UNIX

      ....

      /Midrange

           /BSA

           /REC

                /AIX

           /AH-QA

                /HP-UX

                     /B.11.31

       

      Is there a way (blcli_execute) to pull all servers listed under "/Midrange"?  Appreciate your help!

        • 1. Re: Is there a way to find all servers under a particular group whereas there are multiple groups under the top group
          Siddu angadi

          Please refer the below link.

           

          https://communities.bmc.com/communities/docs/DOC-23498

           

          Please put your complete name in community.

           

          Thanks

          Siddu

          1 of 1 people found this helpful
          • 2. Re: Is there a way to find all servers under a particular group whereas there are multiple groups under the top group
            Q Le

            Siddu,

             

            Thanks!  That does give me a list of groups below the root / top level and therefore I’m able to query servers under the found groups.  I need to query all servers under neath the root / top level though.  What if my structure is 3 or 4 or even 5 level deep, I’m supposed I would need to write a recursive program to do that or you have other suggestions?

             

            Q (Anhvu) Le

            EMIT 2.0 | BMC Server Automation

            4400 Dacoma St. #1418E, Houston, TX  77092

            Office 713-431-0327 | Fax 713-431-0451

            anhvu.q.le@exxonmobil.com

            • 3. Re: Is there a way to find all servers under a particular group whereas there are multiple groups under the top group
              Q Le

              Siddu,

               

              I wrote the following but got an error message about “Invalid qualified group name”?  Any ideas?

               

              search-SERVER() {

              local ROOT=${1}

              BLCLICMD=(ServerGroup listChildGroupsInGroup "$")

              Run-BLCLICMD GROUPS

              if ; then

                    for GROUP in $GROUPS; do

                          search-SERVER "$The specified item was not found."

                    done

              else

                    for SERVER in $GROUPS; do

                          echo $SERVER

                    done

              fi

              }

               

              Error       Apr 5, 2013 2:48:29 PM     +search-SERVER:1> local 'ROOT=/Midrange'

              Error       Apr 5, 2013 2:48:29 PM     +search-SERVER:2> BLCLICMD=( ServerGroup listChildGroupsInGroup /Midrange )

              Error       Apr 5, 2013 2:48:29 PM     +search-SERVER:3> Run-BLCLICMD GROUPS

              Error       Apr 5, 2013 2:48:29 PM     +Run-BLCLICMD:1> local 'TMP=GROUPS'

              Error       Apr 5, 2013 2:48:29 PM     +Run-BLCLICMD:2> local 'RETCODE=0'

              Error       Apr 5, 2013 2:48:29 PM     +Run-BLCLICMD:4> '

              Error       Apr 5, 2013 2:48:29 PM     +Run-BLCLICMD:5> blcli_execute ServerGroup listChildGroupsInGroup /Midrange

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:6> RETCODE=0

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:7> '

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:8> blcli_storeenv RESULT

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:9> '

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:10> blcli_storeenv GROUPS

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:12> return 0

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:4> '

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:5> GROUP=NP_2WD_9AM_GMT-6

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:6> search-SERVER NP_2WD_9AM_GMT-6

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:1> local 'ROOT=NP_2WD_9AM_GMT-6'

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:2> BLCLICMD=( ServerGroup listChildGroupsInGroup NP_2WD_9AM_GMT-6 )

              Error       Apr 5, 2013 2:48:38 PM     +search-SERVER:3> Run-BLCLICMD GROUPS

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:1> local 'TMP=GROUPS'

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:2> local 'RETCODE=0'

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:4> '

              Error       Apr 5, 2013 2:48:38 PM     +Run-BLCLICMD:5> blcli_execute ServerGroup listChildGroupsInGroup NP_2WD_9AM_GMT-6

              Error       Apr 5, 2013 2:48:38 PM     Command execution failed. com.bladelogic.om.infra.mfw.util.BlException: Invalid qualified group name : NP_2WD_9AM_GMT-6

               

              Q (Anhvu) Le

              EMIT 2.0 | BMC Server Automation

              4400 Dacoma St. #1418E, Houston, TX  77092

              Office 713-431-0327 | Fax 713-431-0451

              anhvu.q.le@exxonmobil.com

              • 4. Re: Is there a way to find all servers under a particular group whereas there are multiple groups under the top group
                Siddu angadi

                [ -n ServerGroup listChildGroupsInGroup NP_2WD_9AM_GMT-6 ']'

                 

                 

                NP_2WD_9AM_GMT-6 -- group name should be fully qualified group name.

                 

                Thanks

                Siddu

                1 of 1 people found this helpful