6 Replies Latest reply on Apr 3, 2013 7:25 AM by Bill Robinson

    Email Notification on PAJ via blcli

      Hi,

       

      I am trying to set default email notification on Windows Patch analysis Job with following blcli, but this is not working for Windows PAJ.. (dont see any error when I run this commands)

       

      JOB_GROUP_NAME="/Windows/SERVER1"

      blcli_execute Utility createModelObject Notification

      blcli_execute Utility setTargetObject

      blcli_execute Notification setNotificationType 1

      blcli_execute Notification setRecipient abc@foofoo.com

      blcli_execute Notification setStatusTypes 12

      blcli_execute Utility objectToList

      blcli_execute Utility setTargetObject

      blcli_execute Utility storeTargetObject notificationList

      blcli_execute Job findByTypeGroupAndName "$JOB_GROUP_NAME" "PAJ-SERVER1" 7009

      blcli_execute Utility storeTargetObject job

      blcli_execute Job setNotificationList NAMED_OBJECT=notificationList

      blcli_execute Job update NAMED_OBJECT=job

       

      Am I missing anything here ?? I have used this before but now it is not working

       

      Regards

        • 1. Re: Email Notification on PAJ via blcli
          Bill Robinson

          we added this in the DeployJob space - DeployJob setDefaultEmailNotifier:

           

          DeployJob.getDBKeyByGroupAndName     $groupName$ $jobName$    jobKey

          Utility.createModelObject     Notification    -

          Notification.setNotificationType     1    -

          Notification.setRecipient     $recipient$    -

          Notification.setStatusTypes     $statusType$    -

          Utility.storeTargetObject     notifier    -

          Job.findByDBKey     NAMED_OBJECT=jobKey    -

          Job.add     NAMED_OBJECT=notifier    -

          Job.update     no input    -

          Job.getDBKey     no input    -

           

          if you open the patching job, do you see the notification option set ?

          1 of 1 people found this helpful
          • 2. Re: Email Notification on PAJ via blcli

            Hi Bill,

             

            I followed the commands but still I am not able to set email notification on PAJ, I am able to set notification on other jobs Deploy\snapshot\remediation etc.

             

            below are the blcli commands with their outputs, which I tried for PAJ (Also I tried few other ways as well, but not working).

             

            JOB_GROUP="/Test"

            blcli_execute PatchingJob getDBKeyByGroupAndName "$JOB_GROUP" "PAJ_Test"

            DBKey:SJobModelKeyImpl:4-4-2009501

             

            blcli_storeenv JOB_KEY

             

            blcli_execute Utility createModelObject Notification

            com.bladelogic.om.infra.model.notification.NotificationImpl@da322

             

            blcli_execute Notification setNotificationType 1

            void

             

            blcli_execute Notification setRecipient abc@foofoo.com

            void

             

            blcli_execute Notification setStatusTypes 12

            void

             

            blcli_execute Utility objectToList

            [com.bladelogic.om.infra.model.notification.NotificationImpl@395fd63e]

             

             

            blcli_execute Utility storeTargetObject notificationList

            com.bladelogic.om.infra.model.notification.NotificationImpl@395fd63e

             

            blcli_execute Job findByDBKey NAMED_OBJECT="$JOB_KEY"

            com.bladelogic.om.patch.model.job.patching.WindowsPatchingJobImpl@34dafc42

             

            blcli_execute Job add NAMED_OBJECT=notificationList

            true

             

            blcli_execute Job update

            com.bladelogic.om.patch.model.job.patching.WindowsPatchingJobImpl@34dafc42

             


             

            Also I tried the below set of Blcli as well, but no success

             

            blcli_execute Utility createModelObject Notification

            blcli_execute Utility setTargetObject

            blcli_execute Notification setName MySmtpNotification

            blcli_execute Notification setRecipient "abc@xyz.com"

            blcli_execute Notification setStatusTypes 14

            blcli_execute Notification setNotificationType 1

            blcli_execute Utility objectToList

            blcli_execute Utility setTargetObject

            blcli_execute Utility storeTargetObject MyNotificationList

            blcli_execute Job findByTypeGroupAndName "/Test" "PAJ_Test" 7009

            blcli_execute Job addNotificationList NAMED_OBJECT=MyNotificationList

            blcli_execute Job update

             

            Regards

            • 3. Re: Email Notification on PAJ via blcli

              Any help with guys ???? Help would be apprecciated.

              • 4. Re: Email Notification on PAJ via blcli
                Bill Robinson

                so if you set the notification in the gui the notification is actually set on the child analysis job, not the patching job – the patching job is what you see in the gui.  the problem is that if you use the blcli to update the patch analysis job you cannot update the parent job w/ the new job version id of the child patch analysis job you just created and your patching job is now broken.

                 

                you can use the blcli to set the notification on the patchjob job parent and you will get an email, but you won’t see it set in the gui.

                • 5. Re: Email Notification on PAJ via blcli

                  Hi Bill,

                   

                  Thank you for clarification.

                   

                  If I dont see the notification set then it might create confusion down the line. I tried this via blcli and it does not overwrites the old notification set and now i get two notification, to be honest I can not analyze how this is working.

                   

                  I will do further some testing and will kepp updated.

                   

                  Regards

                   

                  Santosh

                  • 6. Re: Email Notification on PAJ via blcli
                    Bill Robinson

                    there's a 'clearNotifcations' or something like that you can use to remove all the existing default notifications.

                    1 of 1 people found this helpful