9 Replies Latest reply on Nov 3, 2011 6:45 AM by Adam Bowen

    Update server properties job

    Erez Frenkel

      Hello,

       

      I configured new parameter (a_datacenter) in the Property Dictionary -> Server ->

       

      I have few smart groups (Group-A, Group-B etc) that on each one of the servers I have the parameter for : a_datacenter : group-a , or group-b

      (for repeater routing rules)

       

      Now I would like to know if there is any option to have a job that check all the servers that on that smart-group, and

      Automatically if it's group-a than - they will get the parameter: group-a (if it's group-b then get group-b etc …)

       

      So every new agent that will be add to the smart- group he will receive automatically the correct a_datacenter parameter

       

      Can we do that?

       

      Thanks,

       

       

      Erez

        • 1. Re: Update server properties job

          ? You are kind of going about this backward. Smart Groups are based upon server properties. So, ideally, servers in Smart Group Group-A would be servers that have that property already set. Smart Groups aren’t folders.

          • 2. Re: Update server properties job
            Erez Frenkel

            Adam, So.. How / Can I add a parameter automatically for all the servers in group-a?

             

            Thanks,

             

            Erez

            • 3. Re: Update server properties job

              Let’s try to better understand what it is you are trying to accomplish. Are the servers already in BladeLogic, or are they going to be added? If you are going to add them, you can import them via the blcli and set the property at import time. (consult the blcli help documentation installed with the BladeLogic console) If they are already added, are they already in a grouped in some manner? If they are already in the system you can right click on a group of servers and choose “set Server property” and set the property for the whole lot at one time.

              • 4. Re: Update server properties job
                Erez Frenkel

                Adam, Servers are going to be added to existing groups manually, Is it possible to automatically receive server parameter? (when they are belong to the group, and not through the BLCLI)

                 

                I dont want to right click on a group of servers and choose “set Server property” -

                I want the Rscd-servers will get it automatically

                 

                 

                 

                Erez

                • 5. Re: Update server properties job

                  But, based upon what you are telling me, that isn't entirely true, otherwise you wouldn't have multiple groups, right? But anyway, you can create the new server property in the property dictionary and then set the default value to whatever value you want (I.e. Group_a). Every server added will automatically have group_a as it's value.

                   

                  But, when you add a new server, you are presented it's property sheet, so you can set the property value then, if servers are going to be manually imported.

                   

                  It is still unclear what you are actually trying to accomplish.

                   

                  Here's what I would do:

                   

                  Make a an enumerated value server property, i.e. server_group with values group_a and group_b, with group_a as a default value.

                   

                  For manual server additions, I will just change the property at addition, if it is not in group_a.

                   

                  For bulk imports, I will use the blcli to import and set the property via the csv file.

                   

                  For existing servers, I would set the property on a group of servers.

                   

                  Adam

                  • 6. Re: Update server properties job
                    Bill Robinson

                    are you manually adding the servers to static groups?  and you want to set a property value based on membership in a static group?

                     

                    you cannot manually add a server to a smart group.

                    • 7. Re: Update server properties job
                      Erez Frenkel

                      Hi Bill / Adam

                       

                      Adam - I don't want to "just change the property"  I want to know if we can do it automatically.

                       

                      Bill - Yes I'm manually adding the servers to a static groups, and I want to set a property value based on membership in a static group.

                       

                      Now I would like that each rscd-agent will get the correct property value - automatically based on his group,

                       

                      Thanks a lot,

                       

                      Erez

                      • 8. Re: Update server properties job
                        Bill Robinson

                        Instead of adding the server into the static group, why can't you set the property value when you import the server?  what is the purpose of the static group?

                         

                         

                        to automate how you want it to work now you would do something like:

                        ----------

                        staticGroups="groupA groupB groupC"

                        for groupName in ${staticGroups}

                             do

                             blcli_execute Server listServersInGroup "/${groupName}"

                             blcli_storeenv serverList

                             for server in ${serverList}

                                  do

                                   blcli_execute Server setPropertyValueByName "${server}" PROPERTY_NAME "${groupName}"

                             done

                        done

                        ---------

                        this assumes:

                        • the value you want to set in the property is the name of the static group.
                        • the static server groups are in the root of the server workspace

                         

                        because this iterates through each server it may be slow.  if you have hundreds of servers in each group we might be better off using a bulk set command to set the property values.  let me know if you want to see that.

                        1 of 1 people found this helpful
                        • 9. Re: Update server properties job

                          This is pretty much what I told him on the beginning. Erez, you are looking to create an intrinsic property and there is no way to do that. Pick a way that Bill and I laid out for you. If you are already putting them in a group by a GUI, then set the property at import time. It is only one more step, and no more complicated than adding them to the group. Like Bill said below, you can use that script to do it as a scheduled job too \.

                          1 of 1 people found this helpful