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