AutoSys Workload Automation

 View Only

 Notifications

Jump to  Best Answer
Corrie Kantowski's profile image
Corrie Kantowski posted Jul 26, 2024 02:15 PM

I am testing the use of Notification Services. The notification type I use is "Send notification on selected alarms and job failure" along with an email template. The template has a section of text for [ALARM]. For job failures and the JOBTERMINATED and MUST_START_ALARM alarms, I receive a notification as expected. Other alarm conditions to the Alarm Type field, such as JOBNOT_ONICEHOLD, JOBNOT_ONNOEXEC, KILLJOBFAIL and MAXRUNALARM do not seem to generate a notification. Could you help me troubleshoot this problem?

Richard Heaney's profile image
Broadcom Employee Richard Heaney  Best Answer

Hi Corrie,

To assist you with testing this out, I have attached some test JIL and an email template I used.

Using the JIL and template, I ran force started the box and the first two jobs should create an email as standard.

i.e. rh_email_test_max_run_alarm_c
- Within the job itself, have the command run longer than the max_run_alarm attribute and it will send a failure email
rh_email_test_job_fail_alarm_c
- Just let the job fail and it will send a failure email
The next two jobs in the box will require some sendevents to be issued:
rh_email_test_not_onnoexec_alarm_c
 - Issue this command whilst the job is running: sendevent -E JOB_ON_NOEXEC -J rh_email_test_not_onnoexec_alarm_c
- it should send a failure email
rh_email_test_not_onicehold_alarm_c
- Issue this command whilst the job is running: sendevent -E JOB_ON_ICE -J rh_email_test_not_onicehold_alarm_c
- it should send a failure email
I hope the above helps with the testing and further information on how the alarms work can be found here:
https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/reference/ae-system-states/alarms.html#concept.dita_1cf4b00c7dfc58763d031ee5b3734bccda129c92_JOBNOTONICEHOLD509
Best regards
Richie Heaney
Richard Heaney's profile image
Broadcom Employee Richard Heaney

Hi Carrie,

To troubleshoot the issue, I ran the following tests:

Some test JIL that I created:
 
/* ----------------- rh_email_test_b ----------------- */
 
insert_job: rh_email_test_b   job_type: BOX
owner: autosys
permission:
date_conditions: 1
days_of_week: all
start_times: "10:00"
term_run_time: 300
alarm_if_fail: 1
alarm_if_terminated: 1
 
 
 /* ----------------- rh_email_test_max_run_alarm_c ----------------- */
 
 insert_job: rh_email_test_max_run_alarm_c   job_type: CMD
 box_name: rh_email_test_b
 command: as_test -t 65
 machine: localhost
 owner: autosys@rhean-rhautosysdevserv
 permission:
 date_conditions: 0
 max_run_alarm: 1
 alarm_if_fail: 1
 alarm_if_terminated: 1
 send_notification: 1
 notification_template: "email_input"
 notification_alarm_types: JOBFAILURE
 notification_alarm_types: MAXRUNALARM
 notification_emailaddress_on_alarm: richard.heaney@broadcom.com
 
 
 /* ----------------- rh_email_test_job_fail_alarm_c ----------------- */
 
 insert_job: rh_email_test_job_fail_alarm_c   job_type: CMD
 box_name: rh_email_test_b
 command: fail
 machine: localhost
 owner: autosys@rhean-rhautosysdevserv
 permission:
 date_conditions: 0
 alarm_if_fail: 1
 alarm_if_terminated: 1
 send_notification: 1
 notification_template: "email_input"
 notification_alarm_types: JOBFAILURE
 notification_emailaddress_on_alarm: richard.heaney@broadcom.com
 
 
 /* ----------------- rh_email_test_not_onnoexec_alarm_c ----------------- */
 
 insert_job: rh_email_test_not_onnoexec_alarm_c   job_type: CMD
 box_name: rh_email_test_b
 command: as_test -t 60
 machine: localhost
 owner: autosys@rhean-rhautosysdevserv
 permission:
 date_conditions: 0
 max_run_alarm: 1
 alarm_if_fail: 1
 alarm_if_terminated: 1
 send_notification: 1
 notification_template: "email_input"
 notification_alarm_types: JOBNOT_ONNOEXEC
 notification_emailaddress_on_alarm: richard.heaney@broadcom.com
 
 
 /* ----------------- rh_email_test_not_onicehold_alarm_c ----------------- */
 
 insert_job: rh_email_test_not_onicehold_alarm_c   job_type: CMD
 box_name: rh_email_test_b
 command: as_test -t 60
 machine: localhost
 owner: autosys@rhean-rhautosysdevserv
 permission:
 date_conditions: 0
 max_run_alarm: 1
 alarm_if_fail: 1
 alarm_if_terminated: 1
 send_notification: 1
 notification_template: "email_input"
 notification_alarm_types: JOBNOT_ONICEHOLD
 notification_emailaddress_on_alarm: richard.heaney@broadcom.com
 
 
Email template that I used and stored in my /tmp directory:
 
[SUCCESS]
SUBJECT=AutoSys Workload Automation - Job: <<<job_name>>> Status: <<<job_status>>> DO_NOT_REPLY
MESSAGE=[start]
------------------------------------------------------------------------------
 AutoSys Workload Automation - Automated Email Notification
------------------------------------------------------------------------------
 Instance:                                                    <<instance>>
 Scheduler host:                                              <<scheduler_host>>
 
 Job name:                                                    <<job_name>>
 Status:                                                      <<job_status>>
 Job run machine:                                             <<run_machine>>
 Job run identifier:                                          <<run_identifier>>
 Job start time:                                              <<start_time>>
 Job completion time:                                         <<completion_time>>
 Exit code:                                                   <<exit_code>>
 
------------------------------------------------------------------------------
 Note: This email was automatically generated based on the job definition.
 Please do not reply.
------------------------------------------------------------------------------
[end]
STDOUT=no
STDERR=no
SPOOL=no
JOBLOG=no
LOG_LINES=2000
 
[FAILURE]
SUBJECT=AutoSys Workload Automation - Job: <<<job_name>>> Status: <<<job_status>>> DO_NOT_REPLY
MESSAGE=[start]
------------------------------------------------------------------------------
 AutoSys Workload Automation - Automated Email Notification
------------------------------------------------------------------------------
 Instance:                                                    <<instance>>
 Scheduler host:                                              <<scheduler_host>>
 
 Job name:                                                    <<job_name>>
 Status:                                                      <<job_status>>
 Job run machine:                                             <<run_machine>>
 Job run identifier:                                          <<run_identifier>>
 Job start time:                                              <<start_time>>
 Job completion time:                                         <<completion_time>>
 Exit code:                                                   <<exit_code>>
 
------------------------------------------------------------------------------
 Note: This email was automatically generated based on the job definition.
 Please do not reply.
------------------------------------------------------------------------------
[end]
STDOUT=no
STDERR=no
SPOOL=no
JOBLOG=no
LOG_LINES=2000
 
[TERMINATED]
SUBJECT=AutoSys Workload Automation - Job: <<<job_name>>> Status: <<<job_status>>> DO_NOT_REPLY
MESSAGE=[start]
------------------------------------------------------------------------------
 AutoSys Workload Automation - Automated Email Notification
------------------------------------------------------------------------------
 Instance:                                                    <<instance>>
 Scheduler host:                                              <<scheduler_host>>
 
 Job name:                                                    <<job_name>>
 Status:                                                      <<job_status>>
 Job run machine:                                             <<run_machine>>
 Job run identifier:                                          <<run_identifier>>
 Job start time:                                              <<start_time>>
 Job completion time:                                         <<completion_time>>
 Exit code:                                                   <<exit_code>>
 
------------------------------------------------------------------------------
 Note: This email was automatically generated based on the job definition.
 Please do not reply.
------------------------------------------------------------------------------
[end]
STDOUT=no
STDERR=no
SPOOL=no
JOBLOG=no
LOG_LINES=2000
 
[ALARM]
SUBJECT=AutoSys Workload Automation - Job: <<<job_name>>> Alarm: <<<alarm_name>>> DO_NOT_REPLY
MESSAGE=[start]
------------------------------------------------------------------------------
 AutoSys Workload Automation - Automated Email Notification
------------------------------------------------------------------------------
 Instance:                                                    <<instance>>
 Scheduler host:                                              <<scheduler_host>>
 
 Job name:                                                    <<job_name>>
 Status:                                                      <<job_status>>
 Job run machine:                                             <<run_machine>>
 Job run identifier:                                          <<run_identifier>>
 Job start time:                                              <<start_time>>
 Job completion time:                                         <<completion_time>>
 Exit code:                                                   <<exit_code>>
 Alarm Message:                                               <<alarm_message>>
 
------------------------------------------------------------------------------
 Note: This email was automatically generated based on the job definition.
 Please do not reply.
------------------------------------------------------------------------------
[end]
STDOUT=no
STDERR=no
SPOOL=no
JOBLOG=no
LOG_LINES=2000
 
 
You then kick off the box and the first two jobs should email you automatically.
 
rh_email_test_max_run_alarm_c
- Within the job itself, have the command run longer than the max_run_alarm attribute and it will send a failure email
rh_email_test_job_fail_alarm_c
- Just let the job fail and it will send a failure email
These two jobs :
rh_email_test_not_onnoexec_alarm_c
rh_email_test_not_onicehold_alarm_c
you then need to let them start off and then issue these commands:
- Issue a NO_EXEC command whilst the job is running and it should send a failure email, i.e. sendevent -E JOB_ON_NOEXEC -J rh_email_test_not_onnoexec_alarm_c
- Issue an ON_ICE command whilst the job is running and it should send a failure email, i.e. sendevent -E JOB_ON_ICE -J rh_email_test_not_onicehold_alarm_c
 
An email should then be sent to your inbox. 
For further details on the alarm types and how they work can be found here:
 
https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/reference/ae-system-states/alarms.html#concept.dita_1cf4b00c7dfc58763d031ee5b3734bccda129c92_JOBNOTONICEHOLD509
I hope the above helps you with your testing!
Best regards
Richie