14 Replies Latest reply on Jul 3, 2012 8:12 AM by Jim Wilson

    BLCLI to Import Patch quenumber while Creating Patch Analysis Job   (BSA: 8.2.0.158 )

      running following script:

       

      JOB_GROUP=/test2
      TARGET_GROUP="/Workspace/All Servers"
      CATALOG_NAME="/Catalogs/Windows 2008 Patch catalog/using KB articles"
      JOB_KEY=`blcli -v defaultProfile -r BLAdmins PatchingJob createWindowsPatchingJobWithTargetGroup PAJob2 "$JOB_GROUP"

      "$TARGET_GROUP" "$CATALOG_NAME" "//localhost/e/include.txt" "//localhost/e/exclude.txt" true true true true`

       

      include.txt contain following:

      Q2640148

      Q2660075

      Q2603469

      Q2600217

      Q2597091

      Q2647093

      QLIBO350

      Q130989

       

      exclude.txt contain following:

      Q131837

       

       

      Include file are working perfectly fine if adding it using GUI..

       

       

      It is neither creating Patch Analysis Job, nor showing any erorr.

       

      but if i keep include.txt and exclude.txt file empty.. its is creating Patch Analysis job but by default group option checked as following in pic...

       

      2.gif

        • 1. BLCLI to create Patch Analysis Job

          This is the same you are disussing on other thread

          https://communities.bmc.com/communities/thread/55251?start=15&tstart=0

           

           

          Did you try with a group whose name does not contain space and simple use the format

           

          Group#<name of the group>

           

          The text I pasted earlier is from the BLCLI Help

          The jobGroupName argument provides the fully qualified path to the parent group.

          The targetGroupName argument provides the target group name for the new Patching job.

          The catalog name provides the fully qualified path for the catalog already defined.

          The include/exclude list text file could have entries for smart groups and/or depot objects one on each line.

          The depot objects and the smart group should be existing in the catalog before running this command.

             To include the depot object add NAME#(name of the depot object)" in the include file.

             To include a smart group add "GROUP#(complete path to the smart group)" in the include file.

                for instance an example of the contents in the include/exclude list file could be

                NAME#APSB-0611

                GROUP#/Catalog/TestCatalog1/smartGroup1

          • 2. BLCLI to create Patch Analysis Job

            ran following:

             

            JOB_GROUP=/test2
            TARGET_GROUP="/Workspace/All Servers"
            CATALOG_NAME="/Catalogs/Win8PatchCatalog"
            JOB_KEY=`blcli -v defaultProfile -r BLAdmins PatchingJob createWindowsPatchingJobWithTargetGroup PAJob8 "$JOB_GROUP"

            "$TARGET_GROUP" "$CATALOG_NAME" "//localhost/E/include.txt" "//localhost/E/exclude.txt" true false false false`

             

            now include file contains following:

            Group#/Catalogs/Win8PatchCatalog/Bulletins

             

            and exclude file contains following:

            Group#/Catalogs/Win8PatchCatalog/Hotfixes

             

            It is creating Patch analysis Job but doesn't contain include or exclude list

            • 3. BLCLI to create Patch Analysis Job

              Did you get anything any errors in the blcli.log ?

              • 4. BLCLI to create Patch Analysis Job

                it has following

                 

                25 Apr 2012 06:48:37,815 ERROR [MESSAGE] Unknown command : name space = 'PatchingJob', command = 'createWindowsPatchingJobWithTargetGroup'. [/MESSAGE]

                com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Found command 'PatchingJob.createWindowsPatchingJobWithTargetGroup' but with mismatching arguments.

                at com.bladelogic.om.infra.cli.factory.CommandTemplateInventory.getCommandTemplate(CommandTemplateInventory.java:159)

                at com.bladelogic.om.infra.cli.factory.CommandFactory.getCommand(CommandFactory.java:69)

                at com.bladelogic.om.infra.cli.CLIEngine.executeCommand(CLIEngine.java:109)

                at com.bladelogic.om.infra.cli.CLIMain.runSingleCommand(CLIMain.java:384)

                at com.bladelogic.om.infra.cli.CLIMain.main(CLIMain.java:180)

                Caused by: java.lang.IllegalArgumentException: Wrong number of arguments provided to method : createWindowsPatchingJobWithTargetGroup expected : 10 received : 11

                at com.bladelogic.om.infra.cli.factory.CommandTemplate.convertArgsToRealArgs(CommandTemplate.java:445)

                at com.bladelogic.om.infra.cli.factory.CommandTemplateInventory.getCommandTemplate(CommandTemplateInventory.java:156)

                ... 4 more

                25 Apr 2012 06:48:37,817 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                25 Apr 2012 22:46:26,049 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                25 Apr 2012 22:46:46,418 INFO [MESSAGE] DBKey:SJobModelKeyImpl:506-1-2026422 [/MESSAGE]

                25 Apr 2012 22:46:47,569 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                25 Apr 2012 22:47:23,649 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                25 Apr 2012 22:47:32,355 INFO [MESSAGE] Command execution failed.  [/MESSAGE]

                com.bladelogic.om.infra.mfw.util.BlException: A job with the name 'PAJob9' already exists in this group.

                at com.bladelogic.om.infra.model.job.JobImpl.save(JobImpl.java:1425)

                at com.bladelogic.om.patch.model.job.patching.PatchingJobImpl.save(PatchingJobImpl.java:279)

                at com.bladelogic.om.infra.model.job.JobImpl.create(JobImpl.java:1328)

                at com.bladelogic.om.infra.model.job.JobFactory$1.doDBOperation(JobFactory.java:1865)

                at com.bladelogic.om.infra.app.db.TransactionalOperation.manageTransaction(TransactionalOperation.java:174)

                at com.bladelogic.om.infra.app.db.TransactionalOperation.execute(TransactionalOperation.java:136)

                at com.bladelogic.om.infra.model.job.JobFactory.create(JobFactory.java:1868)

                at com.bladelogic.om.infra.app.api.factory.JobServiceImpl.create(JobServiceImpl.java:183)

                at com.bladelogic.om.infra.app.api.JobServiceRequestHandlerImpl.create_10(JobServiceRequestHandlerImpl.java:791)

                at com.bladelogic.om.infra.app.api.JobServiceRequestHandlerImpl.execute(JobServiceRequestHandlerImpl.java:334)

                at com.bladelogic.om.infra.app.api.manage.APIMethodInvocationProvider.executeRequest(APIMethodInvocationProvider.java:54)

                at com.bladelogic.om.infra.app.api.manage.APIMethodInvocationProvider.invoke(APIMethodInvocationProvider.java:39)

                at com.bladelogic.om.infra.app.service.routing.RoutingServiceImpl.invokeMethodLocally(RoutingServiceImpl.java:317)

                at com.bladelogic.om.infra.app.service.routing.RoutingServiceImpl.invoke(RoutingServiceImpl.java:244)

                at com.bladelogic.om.infra.app.api.manage.APIRequestManager.executeRequest(APIRequestManager.java:30)

                at com.bladelogic.om.infra.message.app.frame.APIMessageFrame.service(APIMessageFrame.java:101)

                at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.processRequest(ClientWorkerThread.java:385)

                at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.processClientRequest(ClientWorkerThread.java:282)

                at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.handleClientRequest(ClientWorkerThread.java:182)

                at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.execute(ClientWorkerThread.java:101)

                at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.execute(ClientWorkerThread.java:27)

                at com.bladelogic.om.infra.app.service.thread.BlBlockingThread.run(BlBlockingThread.java:95)

                25 Apr 2012 22:47:32,360 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                • 5. BLCLI to create Patch Analysis Job

                  It worked for me without any problems

                   

                  Here is my command

                  blcli_setoption serviceProfileName SRP
                  blcli_setoption roleName BLAdmins
                  blcred cred -acquire -profile SRP -username BLAdmin -password "xxx"
                  blcli_connect

                  JOB_GROUP=/Setup
                  TARGET_GROUP=/all
                  CATALOG_NAME=/Patch_Catalogs/SampleWindowsCatalog
                  JOB_KEY=`blcli -v defaultProfile -r BLAdmins PatchingJob createWindowsPatchingJobWithTargetGroup PAJob9 "$JOB_GROUP" "$TARGET_GROUP" "$CATALOG_NAME" "//localhost/var/tmp/inc.txt" "//localhost/var/tmp/exc.txt" true false false false`

                   

                  Also, when I specified //localhost/var/tmp/inc.txt

                  The AGENT ACLS and user mapping should allow the agent to access this file else you will get errors in the blcli

                  Unfortunately, this bllci does not throw such error on the standard out or standard error.

                  ALso, Make sure the word "GROUP" is in capital letters, here is my inc.txt file

                   

                  GROUP#/Patch_Catalogs/SampleWindowsCatalog/test

                   

                  This

                  /Patch_Catalogs/SampleWindowsCatalog/test

                   

                  is the complete path of the smart group

                  Patch_Catalogs is the parent depot folder

                  SampleWindowsCatalog is the name of the windows catalog

                  and test is the name of the smart group

                   

                  Truncate your blcli.log file

                  and try again making sure everythign is correct and also the permissions to the include/exclude files

                  • 6. Re: BLCLI to create Patch Analysis Job

                    /var/tmp exist in linux  not in windows.. it means you are running this on Unix Platform..

                     

                    but my APP Server 8.2 is installed in Windows 2008 server R2

                     

                    I ran Exactly as your above instruction.. and there is no such issue with inc.txt / exc.txt permission..but list option not enabled and quenumber file (inc.txt) not included.

                    • 7. BLCLI to create Patch Analysis Job

                      I dont thnk it can be a problem specific to Windows.

                      what about the blcli.log

                      Do one this

                      The way you are runnign this blcli

                      same login user ,

                      do this

                      nsh

                      cat //localhost/E/exclude.txt

                      cat //localhost/E/include.txt

                       

                      and paste the output

                       

                       

                      Thanks,

                      Rohit

                      • 8. BLCLI to create Patch Analysis Job

                        cat //localhost/E/include.txt

                        Group#/Catalogs/Win8PatchCatalog/BulletinsWIN-DM9K9I4KGA5#

                         

                        cat //localhost/E/exclude.txt

                        Group#/Catalogs/Win8PatchCatalog/HotfixesWIN-DM9K9I4KGA5#

                         

                        WIN-DM9K9I4KGA5#   is my nsh prompt and the above is output of file...

                        • 9. BLCLI to create Patch Analysis Job

                          You may be surprised.

                          but as I said , the keyword GROUP should be in capital letters

                          • 10. Re: BLCLI to create Patch Analysis Job

                            Rohit I had tried Capital GROUP as well..  anyway..

                             

                            blcli_setoption serviceProfileName defaultProfile

                            blcli_setoption roleName BLAdmins

                            blcred cred -acquire -profile defaultProfile -username BLAdmin -password bladelogic

                            blcli_connect

                            JOB_GROUP=/test2

                            TARGET_GROUP="/Workspace/All Servers"

                            CATALOG_NAME="/Catalogs/Win8PatchCatalog"

                            JOB_KEY=`blcli -v defaultProfile -r BLAdmins PatchingJob createWindowsPatchingJobWithTargetGroup PAJob11 "$JOB_GROUP" "$TARGET_GROUP" "$CATALOG_NAME" "//localhost/e/include2.txt" "//localhost/e/exclude2.txt" true false false false`

                             

                             

                             

                            cat //localhost/E/include2.txt

                            GROUP#/Catalogs/Win8PatchCatalog/Bulletins

                             

                            cat //localhost/E/exclude2.txt

                            GROUP#/Catalogs/Win8PatchCatalog/Hotfixes

                             

                             

                             

                            Note: Everytime when i make GROUP in CAPITAL.. Script create no JOB... but when i make it Group.. it atleast create Patch Analysis Job with List option disabled.

                             

                             

                             

                             

                             

                            BLCLI.Log

                             

                            26 Apr 2012 00:31:29,770 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                            26 Apr 2012 02:15:53,710 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                            26 Apr 2012 02:16:02,634 INFO [MESSAGE] void [/MESSAGE]

                            26 Apr 2012 02:16:02,636 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                            26 Apr 2012 02:16:14,255 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                            26 Apr 2012 02:16:18,189 INFO [MESSAGE] void [/MESSAGE]

                            26 Apr 2012 02:16:18,190 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                            26 Apr 2012 02:16:29,847 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                            26 Apr 2012 02:16:35,718 INFO [MESSAGE] void [/MESSAGE]

                            26 Apr 2012 02:16:35,720 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                            26 Apr 2012 02:32:46,231 INFO [MESSAGE] Starting CLI session for single command [/MESSAGE]

                            26 Apr 2012 02:32:55,710 INFO [MESSAGE] Command execution failed.  [/MESSAGE]

                            com.bladelogic.om.infra.mfw.util.BlException: Unexpected exception while handling request: com.bladelogic.om.patch.service.PatchingJobService_setWindowsAnalysisOptions(com.bladelogic.om.patch.model.job.patching.PatchingJob, java.lang.String, java.lang.String, boolean, boolean, boolean, boolean), msg = Could not initialize class com.bladelogic.om.infra.client.ui.common.UIBeanUtil

                            at com.bladelogic.om.infra.app.api.manage.APIRequestManager.executeRequest(APIRequestManager.java:40)

                            at com.bladelogic.om.infra.message.app.frame.APIMessageFrame.service(APIMessageFrame.java:101)

                            at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.processRequest(ClientWorkerThread.java:385)

                            at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.processClientRequest(ClientWorkerThread.java:282)

                            at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.handleClientRequest(ClientWorkerThread.java:182)

                            at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.execute(ClientWorkerThread.java:101)

                            at com.bladelogic.om.infra.mfw.net.ClientWorkerThread.execute(ClientWorkerThread.java:27)

                            at com.bladelogic.om.infra.app.service.thread.BlBlockingThread.run(BlBlockingThread.java:95)

                            26 Apr 2012 02:32:55,717 INFO [MESSAGE] Cancelling operation... [/MESSAGE]

                            • 11. BLCLI to Import Patch quenumber while Creating Patch Analysis Job

                              It is because when you use "Group" it does not try to set  the list option on the job

                              but when you use this "GROUP", it does that , and seems like in doing that it is getting this exception

                               

                              com.bladelogic.om.infra.mfw.util.BlException: Unexpected exception while handling request: com.bladelogic.om.patch.service.PatchingJobService_setWindowsAnalysisOptions(com.bladelogic.om.patch.model.job.patching.PatchingJob, java.lang.String, java.lang.String, boolean, boolean, boolean, boolean), msg = Could not initialize class com.bladelogic.om.infra.client.ui.common.UIBeanUtil

                              at com.bladelogic.om.infra.app.api.manage.APIRequestManager.executeRequest

                               

                              What version of Appserver are you running this ?

                              I tried it on 8.1 SP4

                              • 12. Re: BLCLI to Import Patch quenumber while Creating Patch Analysis Job

                                 

                                 

                                Currently using Version: 8.2.0.158           I tested it on 8.1 and it is working but on 8.2

                                 

                                • 14. BLCLI to Import Patch quenumber while Creating Patch Analysis Job   (BSA: 8.2.0.158 )
                                  Jim Wilson

                                  Wali,

                                   

                                  Please update the thread with the results of your communication with support.

                                   

                                  Thanks & Regards