There is a business requirement where the business unit only wants to be notified when their jobs fails or their max run time is exceeded.
The key JIL attributes that need to be defined in order to allow for this functionality are as follows:
Consider the use case: I only want to be notified if my job FAILS or when the max run time of 1 minute is exceeded. I do not want to be notified for any other statuses or alarms for this job.
Sample JIL definition:
/* ----------------- test_notify_job ----------------- */
insert_job: test_notify_job job_type: CMD
command: sleep 240
machine: localhost
owner: autosys
permission:
date_conditions: 0
description: "Notify on JOBFAILURE and MAXRUNALARM only"
max_run_alarm: 1
alarm_if_fail: 1
alarm_if_terminated: 1
send_notification: 1
notification_template: "your_email_template"
notification_alarm_types: JOBFAILURE, MAXRUNALARM
notification_emailaddress_on_alarm: [email protected]
The following message references would be noted in event_demon log if max run time is exceeded:
[01/02/2025 20:05:32] CAUAJM_I_40245 EVENT: ALARM ALARM: MAXRUNALARM JOB: test_notify_job MACHINE: test_agent
[01/02/2025 20:05:32] <Job still running. Alarmtime = 1 Mins>
[01/02/2025 20:05:32] CAUAJM_I_20215 Email notification pending for job <test_notify_job> with run number <105149.1> for alarm <MAXRUNALARM>.
[01/02/2025 20:05:33] CAUAJM_I_20209 Email notification sent successfully for job <test_notify_job> with run number <105149.1> for alarm <MAXRUNALARM>.
Whileas for job failure, the following would be noted:
[01/02/2025 20:53:07] CAUAJM_I_40245 EVENT: CHANGE_STATUS STATUS: FAILURE JOB: test_notify_job MACHINE: test_agent EXITCODE: 127
[01/02/2025 20:53:07] CAUAJM_W_10614 Email notification is not sent for job <test_notify_job>.
[01/02/2025 20:53:07] CAUAJM_I_40245 EVENT: ALARM ALARM: JOBFAILURE JOB: test_notify_job MACHINE: test_agent EXITCODE: 127
[01/02/2025 20:53:07] CAUAJM_I_20215 Email notification pending for job <test_notify_job> with run number <105150.1> for alarm <JOBFAILURE>.
[01/02/2025 20:53:09] CAUAJM_I_20209 Email notification sent successfully for job <test_notify_job> with run number <105150.1> for alarm <JOBFAILURE>.
Under both above circumstances, an email would have been generated for the appropriate alarm type and sent out to the address defined in the job definition.
See Alarms in the product guide for listing of alarms that can be used for notification, which get defined in the notification_alarm_types attribute of your JIL.