8 Replies Latest reply on Apr 26, 2012 1:49 AM by wali NameToUpdate

    Set Windows Patch Analysis Job Options

    David Crim

      I need to stop excluding service packs on 50+ Windows patch analysis jobs.  The blcli namespace/command "PatchingJob setWindowsAnalysisOptions" seems like it fits the bill, but I am unsure of how to use it.   Is there an example of its correct usage?  Specifically, I do not know how to obtain the required "com.bladelogic.om.patch.model.job.patching.PatchingJob" input.

        • 1. Set Windows Patch Analysis Job Options
          Bill Robinson

          blcli_execute PatchingJob getDBKeyByGroupAndName "/path/to" "job"

          blcli_storeenv jobKey

          blclI_exectue Job findByDBKey ${jobKey}

          blcli_storeenv patchingJob

          blcli_execute PatchingJob setWindowsAnalysisOptions NAMED_OBJECT=patchingJob args..

          1 of 1 people found this helpful
          • 2. Set Windows Patch Analysis Job Options
            David Crim

            Many thanks!  It was just missing one thing.  I got an error using the NAMED_OBJECT=patchingJob until I included the "storeTargetObject" part.  Here's my version:

             

            blcli_execute PatchingJob getDBKeyByGroupAndName "/path/to" "job"

            blcli_storeenv jobKey

            blcli_execute Job findByDBKey ${jobKey}

            blcli_storeenv patchingJob

            blcli_execute Utility storeTargetObject patchingJob

            blcli_execute PatchingJob setWindowsAnalysisOptions NAMED_OBJECT=patchingJob "" "" true true true false

            #of course, we have to update the job; setWindowsAnalysisOptions doesn't do it for us

            blcli_execute Job update

            • 3. Re: Set Windows Patch Analysis Job Options
              Bill Robinson

              Sorry – should have been the storeTargetObject for the patchingJob, not storeenv.

              • 4. Set Windows Patch Analysis Job Options

                Creating Patch Analysis Job and 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

                 

                include.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

                 

                • 5. Set Windows Patch Analysis Job Options

                  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

                  • 6. Set Windows Patch Analysis Job Options
                    David Crim

                    I don't think it works with "localhost," at least it didn't for me.  Try using a full NSH path to the file (e.g. //server_fqdn/e/include.txt).  Make sure your role has the proper access to the server, too.

                    • 7. Set Windows Patch Analysis Job Options

                      Hi Powderdc What script worked for you? and what was written in your include.txt and exclude.txt... please send

                       

                      as using hostname didn't work either for me.. and my include.txt has

                      Group#/Catalogs/Win8PatchCatalog/Bulletins

                      • 8. Re: Set Windows Patch Analysis Job Options

                        Can any one answer
                        How to Import Patches from Quenumber File using BLCLI while creating patch analysis job????????