6 Replies Latest reply on Jun 5, 2015 3:06 AM by Nikhil Sureka

    blcli query

    Nikhil Sureka

      Is there a blcli to set compliance result notification.

       

       

      compliance_notification.png

        • 1. Re: blcli query
          Rajkumar Rajpurohit

          Hi Nikhil,

          Yes it is possible, but through unreleased blcli command.

          You can try this:

          Firstly you will need the DBKey of the job.

           

                      blcli_execute Utility createModelObject Notification

                      blcli_execute Notification setRecipient "user1@xyz.com;user2@xyz.com"

                      blcli_execute Notification setStatusTypes 14

                      blcli_execute Notification setNotificationType 1

                      blcli_execute Utility storeTargetObject NotificationList

                      blcli_execute Job findByDBKey $YOUR_JOB_DBKEY

                      blcli_execute Job setOptionValue 303 Y

                      blcli_execute Utility storeTargetObject job

                      blcli_execute Job add NAMED_OBJECT=NotificationList

                      blcli_execute Job update NAMED_OBJECT=job

           

          Thanks

          Rajkumar.

          • 2. Re: blcli query
            Nikhil Sureka

            Hi Rajkumar,

             

            I think this unreleased command is for default Job Run notifications,present in the Job.

            • 3. Re: blcli query
              Bill Robinson

              are you trying to set the default notification or a notification on a schedule ?

               

              for the result notification you need to run:

              blcli_execute ComplianceJob getDBKeyByGroupAndName "/Workspace" "Windows 2008 R2 Standard Compliance"

              blcli_storeenv jobKey

              blcli_execute Utility createModelObject Notification

              blcli_execute Notification setRecipient "user1@xyz.com;user2@xyz.com"

              # 32 = consistent, 64=inconsistent

              blcli_execute Notification setStatusTypes 96

              blcli_execute Notification setNotificationType 2

              blcli_execute Notification setAppendAudit true

              blcli_execute Notification setMaxEmailSize 100

              blcli_execute Utility storeTargetObject NotificationList

              blcli_execute Job findByDBKey ${jobKey}

              blcli_execute Utility storeTargetObject job

              blcli_execute Job add NAMED_OBJECT=NotificationList

              blcli_execute Job update NAMED_OBJECT=job

              • 4. Re: blcli query
                Nikhil Sureka

                Hi Bill,

                 

                Thanks for the response. I tried your nsh script, it set the value in the "Job Run Notifications" not in "Compliance Result Notifications".

                 

                I need to set the values in "Compliance Result Notifications" in Compliance Jobs.

                • 5. Re: blcli query
                  Bill Robinson

                  can you show me a screenshot of what you want?  when i run the above this is what the default job notifications look like:

                   

                  • 6. Re: blcli query
                    Nikhil Sureka

                    Hi Bill,

                     

                    I need what is shown in your screenshot.When I tried, it sets the value in "Job Run Notifications".

                    However, I will give a try again.

                     

                    Thanks for the help.