1 2 Previous Next 16 Replies Latest reply on Dec 2, 2011 2:02 AM by Pekka Tiittanen

    blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2

    Kate Fell

      When trying to run any blcli command using AgentAcl  keep getting error, "object is not an instance of declaring class" or "java.lang.NullPointerException"

        • 1. Re: blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
          Bill Robinson

          How are you trying to run these commands?  can you provide some examples?  What are you trying to do here?

          • 2. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
            Kate Fell

            Hi Bill...

             

            We are trying to run a blcli command within a script to map new windows users to a server property, the command that we found is:

             

            AgentAcl setUserMapServerPropertyName ADMIN_ACCOUNT 1

            • 3. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
              Bill Robinson

              That is acting on an Acl object that you have loaded into memory - so you need to have one of those loaded.

               

              so i wrote a couple blcli command a while ago that might do what you want.  if you don't want to drop the xml into files you could just run the command sequences directly w/ the blcli commands.

               

              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE command_inventory SYSTEM "file://bladelogic.com/dtds/Command-Inventory.dtd">

              <command_inventory>

                  <name_space name="RBACRole">

              <complex_command command_id="modifyRoleWithWindowsPropertyMap-UserSync-0001" published="yes" release="yes">

                          <name>modifyRoleWithWindowsPropertyMap</name>

                          <description>

                              <author>Bill Robinson</author>

                              <paragraph>

                               <string_literal/>

                              </paragraph>

                              <return_value_info/>

                          </description>

                          <argument_list>

                <argument desc="name of role to be created" name="roleName">java.lang.String</argument>

                              <argument desc="agent acl flags" name="flags">int</argument>

                <argument desc="unix user map" name="unixUser">java.lang.String</argument>

                              <argument desc="windows property map" name="winProp">java.lang.String</argument>

                          </argument_list>

                          <commands_to_execute>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>findByName</name>

                                  <input>$roleName$</input>

                   <store_result><name>role</name></store_result>

                              </command_invocation>

                  <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>role</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>getAgentAcl</name>

                                  <input></input>

                                  <store_result><name>agentAcl</name></store_result>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>agentAcl</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setFlags</name>

                                  <input>$flags$</input>

                              </command_invocation>

                <command_invocation>

                    <namespace_ref>AgentAcl</namespace_ref>

                    <name>setServerPropertyUsed</name>

                    <input>true 1</input>

                </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setUserMapServerPropertyName</name>

                                  <input>$winProp$ 1</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>role</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>update</name>

                                  <input/>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>getDBKey</name>

                                  <input/>

                              </command_invocation>

                          </commands_to_execute>

                      </complex_command>

                  </name_space>

              </command_inventory>


              and

               

              <?xml version="1.0" encoding="UTF-8"?>

              <!DOCTYPE command_inventory SYSTEM "file://bladelogic.com/dtds/Command-Inventory.dtd">

              <command_inventory>

                  <name_space name="RBACRole">

              <complex_command command_id="createRoleWithWindowsPropertyMap-PS-0001" published="yes" release="yes">

                          <name>createRoleWithWindowsPropertyMap</name>

                          <description>

                              <author>Bill Robinson</author>

                <paragraph>

                 <string_literal/>

                              </paragraph>

                              <return_value_info/>

                          </description>

                          <argument_list>

                              <argument desc="name of role to be created" name="roleName">java.lang.String</argument>

                              <argument desc="description of role to be created" name="roleDesc">java.lang.String</argument>

                              <argument desc="agent acl flags" name="flags">int</argument>

                              <argument desc="unix user map" name="unixUser">java.lang.String</argument>

                              <argument desc="windows property map" name="winProp">java.lang.String</argument>

                          </argument_list>

                          <commands_to_execute>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>createInstance</name>

                                  <input/>

                   <store_result><name>role</name></store_result>

                              </command_invocation>

                  <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>role</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>setName</name>

                                  <input>$roleName$</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>setDescription</name>

                                  <input>$roleDesc$</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>getAgentAcl</name>

                                  <input></input>

                                  <store_result><name>agentAcl</name></store_result>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>agentAcl</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setFlags</name>

                                  <input>$flags$</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setServerPropertyUsed</name>

                                  <input>true 1</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setUserMapServerPropertyName</name>

                                  <input>$winProp$ 1</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>AgentAcl</namespace_ref>

                                  <name>setUserEquivalancy</name>

                                  <input>$unixUser$ 2</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>Utility</namespace_ref>

                                  <name>setTargetObject</name>

                                  <input>role</input>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>create</name>

                                  <input/>

                              </command_invocation>

                              <command_invocation>

                                  <namespace_ref>RBACRole</namespace_ref>

                                  <name>getDBKey</name>

                                  <input/>

                              </command_invocation>

                          </commands_to_execute>

                      </complex_command>

                  </name_space>

              </command_inventory>

              • 5. Re: blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                Pekka Tiittanen

                Hi,

                 

                (Running BBSA 8.1 SP1 Patch2)

                 

                 

                So we (or I) am the original person having this problem. I started running commands from those XML files by hand to see if they work, but end up having this error with setTargetObject:

                 

                SERVER# blcli_execute Utility setTargetObject $ROLE

                Command execution failed. java.lang.IllegalArgumentException: No named object exists by name : com.bladelogic.om.infra.model.rbac.RBACRoleImpl@96a5529f

                 

                $ROLE being the return value of either RBACRole createInstance or RBACRole findByName $ROLENAME

                 

                Or, does the setTargetObject only work when run from complex command?

                • 6. Re: blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                  Bill Robinson

                  take out the $

                   

                  blcli_execute Utility setTargetObject ROLE

                   

                  however, that assumes you have saved the target like:

                   

                  blcli_execute Utility storeTargetObject ROLE.

                  • 7. Re: blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                    Pekka Tiittanen

                    That worked for that bit, but now I am again back to the starting point. I was assuming this would go kind of like this:

                     

                    blcli_execute RBACRole findByName Xxx_01_FI_UnixAdmins

                     

                    blcli_execute Utility storeTargetObject ROLE

                     

                    blcli_execute Utility setTargetObject ROLE

                     

                    blcli_execute RBACRole getAgentAcl

                     

                    blcli_execute Utility storeTargetObject agentAcl

                     

                    blcli_execute Utility setTargetObject agentAcl

                     

                    blcli_execute AgentAcl setFlags 8 -> ??

                     

                    At this point I am receiving, once again, this:

                     

                    Command execution failed. java.lang.IllegalArgumentException: object is not an instance of declaring class

                     

                    I did try this with setTargetObject ROLE too, but ended with the same error message

                    • 8. Re: blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                      Bill Robinson

                      blcli_execute RBACRole findByName Xxx_01_FI_UnixAdmins

                      blclI_execute Utilty storeTargetObject role

                      blcli_execute RBACRole getAgentAcl

                      blcli_execute Utility storeTargetObject agentAcl

                      blcli_execute Utility setTargetObject agentAcl

                      bcli_execute AgentAcl setFlags 8

                       

                       

                      did you try using the xml file and running the command i created that runs the whole sequence ?  does that work?

                      • 9. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                        Pekka Tiittanen

                        Bill Robinson wrote:

                         

                        blcli_execute RBACRole findByName Xxx_01_FI_UnixAdmins

                        blclI_execute Utilty storeTargetObject role

                        blcli_execute RBACRole getAgentAcl

                        blcli_execute Utility storeTargetObject agentAcl

                        blcli_execute Utility setTargetObject agentAcl

                        bcli_execute AgentAcl setFlags 8


                         

                        I keep ending up with the same error. This isnt' really a blocker, but just annoying detail we must remember to change manually after creating the roles with a script.

                         

                        Bill Robinson wrote:


                        did you try using the xml file and running the command i created that runs the whole sequence ?  does that work?

                         

                        No, I haven't had time to figure out how to do that. Any help appreciated, again.

                        • 10. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                          Bill Robinson

                          I think there were two commands out of order:

                           

                          blcli_execute RBACRole findByName Xxx_01_FI_UnixAdmins

                          blclI_execute Utilty storeTargetObject role

                          blcli_execute RBACRole getAgentAcl

                          blcli_execute Utility setTargetObject agentAcl

                          blcli_execute Utility storeTargetObject agentAcl

                          bcli_execute AgentAcl setFlags 8

                           

                          i did this:

                          % blcli_execute RBACRole findByName Testme

                          com.bladelogic.om.infra.model.rbac.RBACRoleImpl@782a88aa

                          % blcli_execute RBACRole getAgentAcl

                          com.bladelogic.om.infra.model.rbac.AgentAclImpl@541b55f2

                          % blcli_execute Utility setTargetObject

                          com.bladelogic.om.infra.model.rbac.AgentAclImpl@541b55f2

                          % blcli_execute Utility storeTargetObject agentAcl

                          com.bladelogic.om.infra.model.rbac.AgentAclImpl@541b55f2

                          % blcli_execute AgentAcl setFlags 8

                          void

                          • 11. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                            Pekka Tiittanen

                            Works until that, thank you. I need to expand this to do the setServerPropertyUsed etc. I need to try and workout the whole set of commands and the run order.

                            • 12. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                              Pekka Tiittanen

                              Hi,

                               

                               

                              This is what I run:

                               

                               

                              # blcli_execute RBACRole findByName Xxx_01_FI_WindowsAdmins

                              # blcli_execute RBACRole getAgentAcl

                              # blcli_execute Utility setTargetObject

                              # blcli_execute Utility storeTargetObject agentAcl

                              # blcli_execute AgentAcl setFlags 8

                              # blcli_execute AgentAcl setServerPropertyUsed true 1

                              # blcli_execute AgentAcl setUserMapServerPropertyName ADMIN_ACCOUNT 1

                              # blcli_execute Utility setTargetObject role

                              # blcli_execute RBACRole update

                               

                               

                              No errors, but it doesn't set the mapping to ADMIN_ACCOUNT either.

                              • 14. blcli command AgentAcl fails - BBSA v8.1 SP1 Patch 2
                                R V

                                Hi Pekka,

                                 

                                just a hint about integrating the xml-data provided by Bill. One way is to create two files, e.g. RBACRole-Extra1.xml and RBACRole-Extra2.xml in the xml/cli-subdirectory of "br"-dir. That should be all. Then you can use the two new complex commands "createRoleWithWindowsPropertyMap" and "modifyRoleWithWindowsPropertyMap" just like any other blcli-command in the RBACRole-namespace.

                                 

                                Best regards to everyone,

                                Reinhard

                                1 2 Previous Next