3 Replies Latest reply on Nov 13, 2011 4:35 PM by Vivek Madireddy

    NSHScriptJob NameSpace to createNSHScriptJobs

    Vivek Madireddy

      Hello all,


      I am using the following command to in my NSH script to create jobs automatically mentioning the variables needed. The jobs get created at the specific JobGroups which I mention in the command but I am NOT able to add Default Notifications and Description to the job using this command. Any help is greatly appreciated.


      blcli_execute NSHScriptJob createNSHScriptJob  "${JOB_GROUP[$i]}"  "${JOB_NAME[$i]}"  "${JOB_DESC[$i]}"  "${NSH_SCRIPT_GROUP}"  "${NSH_SCRIPT}"  "${TARGET_LIST}" "${TARGET_LIMIT}"


      Thank you,


        • 1. NSHScriptJob NameSpace to createNSHScriptJobs
          Bill Robinson

          there's a note about setting notification here:



          for description you can do that should be right in the command there - the 3rd argument.  is that not taking ?

          • 2. NSHScriptJob NameSpace to createNSHScriptJobs
            Vivek Madireddy
            • The link which you gave me in your reply helped me set a SNMP trap. Is there a way which I can use the Notification namespace to send email when the job is run (Job run notification: Send email to option) under the Default notifications tab.


            • For some reason, I cannot set the description when I create the NSHScriptJob using the following command

            blcli_execute NSHScriptJob createNSHScriptJob  "${JOB_GROUP}"  "${JOB_NAME}"  "${JOB_DESC}"  "${NSH_SCRIPT_GROUP}"  "${NSH_SCRIPT}"  "${TARGET_LIST}" "${TARGET_LIMIT}"


            • I have started using this command to set the description after creating the JOB.

                      blcli_execute Job setDescription ${JOB_KEY} "Description of the job"

            • 3. NSHScriptJob NameSpace to createNSHScriptJobs
              Vivek Madireddy

              I finally figured it out !


              Here is the code



                      echo "INFO: Setting up notifications for ${jobName} job for ${envList[$i]} environment"

                      blcli_execute Utility createModelObject Notification

                      blcli_execute Utility setTargetObject

                      blcli_execute Notification setName SmtpNotification

                      blcli_execute Notification setRecipient ${email}

              # send trap in all cases (success, failure & abortion: 2,8,4)

                      blcli_execute Notification setStatusTypes 14
              #setNotificationType should be 3 for SMTP trap and 1 for default notification

                      blcli_execute Notification setNotificationType 1

                      blcli_execute Utility objectToList

                      blcli_execute Utility setTargetObject

                      blcli_execute Utility storeTargetObject NotificationList

                      blcli_execute Job getJobNameByDBKey ${JOB_KEY}

                      blcli_execute Job addNotificationList NAMED_OBJECT=NotificationList

                      blcli_execute Job update


              Thanks for the support Bill.


              I still have to figure out how to check the box to list the failed servers in the email.