Manage Jobs
Module 1
Unicenter AutoSys JM Architecture
Slide 1 - 2
What is an Instance?
It is a licensed version of Unicenter AutoSys
JM and at least one client machine running a
unique Remote Agent.
Default: ACE
Slide 1 - 3
Architecture & Environment Fundamentals
Event Processor
• Key • Polls database for
Architectural next event
Components • Processes event
• Process Flow
• Database AutoSys Database Remote Agent
Overview
• Job Definition • Runs a single job
- What • Returns job completion
- Where information to the
- When database
• Event Information
- Which job
- What event type
- What event occurs
Slide 1 - 4
Architecture & Environment Fundamentals
1. Event Processor reads
the event. Retrieves job
attributes.
2. Event Processor opens
Event Processor
• Key connection to Remote
Architectural Agent, passes job
Components Remote Agent information, closes
• Process Flow connection.
• Database 3. Remote Agent starts
Overview Job the job.
Event Server
(Database) 4. Job runs to completion,
Remote Agent captures
job’s exit code.
STARTJOB Event 5. Remote Agent writes
job completion event
and exit status
information to database
Slide 1 - 5
Architecture & Environment Fundamentals
Oracle Database Connection from Server
AutoSys Event Processor requires database
• Key connection
Architectural
Components Event Processor reads $AUTOUSER/config.
$AUTOSERV to locate Event Server
• Process Flow
configuration setting
• Database EventServer=MYORACLEDB
Overview
Searches for the TNS alias
MYORACLEDB in tnsnames.ora
Uses network configuration information to connect to
SQL*Net V2 and Oracle database
Slide 1 - 6
Architecture & Environment Fundamentals
Oracle Database Connection from Client
AutoSys Remote Agent requires database
connection
• Key
Architectural The Event Server configuration setting
Components EventServer=MYORACLEDB
was passed from the Event Processor.
• Process Flow
ORACLE_HOME and TNS_ADMIN are set in
• Database environment.
Overview
Searches for the TNS alias
MYORACLEDB in tnsnames.ora
Uses network configuration information to
connect to SQL*Net V2 and Oracle database
Slide 1 - 7
Jobs
A job is a single action that can
be performed on a valid client
machine.
Most large companies require
automation of complex
jobstreams, where a single job
can trigger the start of more
jobs.
Slide 1 - 8
Job Definitions
…tell the Event Processor
WHEN a job
should run
WHERE a job should
run
IF a job should run
(what conditions?)
Slide 1 - 9
Job States
1. Event Processor reads
the event. Sends
CHANGE_STATUS:
STARTING
2. Event Processor
Event Processor passes job information
•Job states
to Remote Agent
•Starting
conditions Remote Agent 3. Remote Agent starts
the job. Sends
CHANGE_STATUS:
RUNNING
Job
Event Server 4. Job runs to completion,
(Database) Remote Agent captures
job’s exit code.
Example State Diagram after a 5. Remote Agent sends
STARTJOB Event CHANGE_STATUS:
SUCCESS or FAILURE
Slide 1 - 10
Job Definitions and Attributes
Job State Values
– INACTIVE
Job has not yet been processed
– ACTIVATED
• Job states
Box that job is in is RUNNING, job not yet started
• Starting
– STARTING
conditions Event Processor initiated Remote Agent
– RUNNING
Job is running
– SUCCESS
Job exited with exit code max_exit_success
– FAILURE
Job exited with exit code max_exit_success
Slide 1 - 11
Job Definitions and Attributes
Job State Values (continued)
– TERMINATED
Job terminated while in a running state
– RESTART
• Job states
Unable to start due to problems, rescheduled
• Starting – QUE_WAIT
conditions Starting conditions met, waiting for resources
– ON_ICE
Job is deactivated
– ON_HOLD
On hold, will not run until JOB_OFF_HOLD
event
Slide 1 - 12
Job Definitions and Attributes
Date and Time Conditions
– Days of week
– Start times or start minutes
– Run windows
– Custom Calendars
Job Dependency Conditions
– Starting Conditions
• Job states
SUCCESS (job name)
• Starting FAILURE (job name)
conditions TERMINATED (job name)
DONE (job name)
– NOTRUNNING (job name)
EXITCODE (job name)
VALUE (global variable)
– Operators
AND OR
= ! > < (for EXITCODE values)
Slide 1 - 13
File Watcher Jobs
Where command jobs start the
command specified in the job
definition, file watcher jobs
start a process that monitors for
a file.
When the watched file is
encountered, a file watcher job
can signal a subsequent job or
jobs to start.
Slide 1 - 14
Box Jobs
A box job contains jobs with
similar starting conditions.
Box jobs can contain any
combination of command or file
watcher jobs.
Slide 1 - 15
Nested Boxes
Slide 1 - 16
Job Streams and Box Job Logic
What Happens when a Box Job Runs
– Box status is changed to RUNNING
– All jobs in Box change status to ACTIVATED
(Note: Jobs in Boxes do not retain statuses from previous Box cycles!)
– Each job is analyzed for additional starting conditions
– All jobs with no additional starting conditions are started, without any
implied order or priority
– Jobs with additional starting conditions remain ACTIVATED until
conditions are met
– Box remains RUNNING as long as there are ACTIVATED or
RUNNING jobs in the Box
– If a Box is TERMINATED before a job in it starts, the job status
changes from ACTIVATED to INACTIVE
– The Box completes with SUCCESS once all jobs in it have completed
successfully
– The status of the Box and the jobs in the Box remain unchanged until
the Box runs again
Slide 1 - 17
Job Streams and Box Job Logic
What Happens when a Box Job Runs
Start 3:00am daily
Date/Time Start
Big_Cycle
Conditions Met Entry in each job’s JIL
Big_job_1 box_name: Big_Cycle
Start
Job Dependency SUCCESS
Condition Met
Big_job_2 box_name: Big_Cycle
Start condition: done (Big_job_1)
Job Dependency SUCCESS
Condition Met
box_name: Big_Cycle
Big_job_3
Start condition: done (Big_job_2)
SUCCESS
Slide 1 - 18
Job Streams and Box Job Logic
Box Attributes
– Two Box attributes override default success or failure of a
Box
box_success
box_failure
– Determine success or failure conditions
– Use care to not define conflicting success and failure
conditions
– Two job attributes force either the job or Box to stop
running
box_terminator: y
specifies if job fails, the Box it is in should terminate
job_terminator: y
specifies that if the Box the job is in fails, the job will terminate
Slide 1 - 19
Job Streams and Box Job Logic
Using ON_HOLD on a job in a Box
Start 3:00am daily
do_statistics RUNNING
update_accounts
SUCCESS
ON_HOLD run_stats
SUCCESS
report_stats ACTIVATED
Slide 1 - 20
Job Streams and Box Job Logic
Using ON_ICE on a job in a Box
Start 3:00am daily
do_statistics
update_accounts
SUCCESS
ON_ICE run_stats
SUCCESS
No dependency,
concurrent start report_stats
SUCCESS
SUCCESS
Slide 1 - 21
Job Streams and Box Job Logic
Using ON_ICE on a job in a Box
– Add additional dependencies for behavior
Start 3:00am daily
do_statistics
Add new
dependency
update_accounts
SUCCESS SUCCESS
ON_ICE run_stats
SUCCESS
report_stats
SUCCESS
SUCCESS
Slide 1 - 22
View Processing of Events
autosyslog
– Displays Event Processor or Remote Agent log files
– Provides useful troubleshooting information
– Syntax:
autosyslog [-e | -J job_name] -p
What are Alarms?
Alarms signal situations requiring your
attention and are informational only.
Alarms are sent through the system as an event.
Alarm Sentry
Watches each instance of Unicenter AutoSys JM for
alarms and displays a color change. Available only in
Windows.
The number in parentheses that follows the instance name represents the number of
open alarms for that instance.
Alarm Manager
In UNIX, the Job Activity Console provides a similar button at the bottom right corner.
Alarms
Alarms
–Maximum Run Time
–Minimum Run Time
–Send Alarm if this job fails
Terminators
–If this job fails, terminate the box it is in
–If the box fails, terminate this job
–Terminate this job ___ minutes after starting
The Advanced Features button on the UNIX Job Definition accesses the
above parameters. In Windows, the same parameters are found on the
Alarms/Terminators tab of the Job Editor.
Advanced Features dialog in Unix GUI
Slide 1 - 28
What is an Event?
An event is any type of status change or service
request posted in the database and processed by
the Event Processor.
Sendevent is a command that permits you to
manually post a change in a job’s status to the
database, to force the processing of that job or
subsequent jobs.
Slide 1 - 29
Sending Events to AutoSys
– Send Event externally sends an event to the
AutoSys database
– Two methods
Send Event dialog
Command line
– Each sent event has an associated list of
parameters
– Can cancel a previously sent event
Slide 1 - 30
Features of the Send Event Dialog
– Accessible from the Job Activity Console or the Scheduler
Console
– Job Name contains the name of the currently selected job, by
default
– Event Types menu lists the types of events that can be sent
– Cancel Previously Sent Event cancels one or more events
scheduled to occur in the future
– Event Parameters
Match On Time indicates that the event to be cancelled is based
on the time in the Future field area
Now or Future specifies when the event is to take place
Comment is a free-form field of text to be associated with the
event in the database
Instance is the instance name for the currently selected job
Send Priority indicates the priority level of the event
Slide 1 - 31
Send Event Dialog (Unix)
Launched from
Job Activity Console
Send Event button
Slide 1 - 32
Send Event Dialog (Windows)
Launched from
Scheduler Console
Send Event button
Slide 1 - 33
On Hold or On Ice?
Cannot Start Can Start
Slide 1 - 34
On Hold vs On Ice
On Ice - The job will not run until a Job Off Ice Event is sent
and all of its starting conditions occur again. The logic
expressed by a job on ice is removed from the jobstream.
On Hold - When taken off hold, the job will run as long as all of
its starting conditions were already met.
Slide 1 - 35
On Ice
Starting conditions for jobs downstream from Job which has
been put on ice, will be evaluated as shown in the following
table:condition is this: it will evaluate this:
success (JobA) TRUE
failure (JobA) FALSE
terminated (JobA) FALSE
done (JobA) TRUE
notrunning (JobA) TRUE
exitcode FALSE
Slide 1 - 36
Send a Kill Job Event
The KILLJOB event is used to kill jobs that
are RUNNING. Sometimes, jobs may run too
long or require too many system resources.
Sending a KILLJOB event will kill the job to
free up the system.
Send a Change Status Event
Forces a change in status to the job specified.
Used with the Status list (bottom left corner of
the Send Event tool) from which you specify
the target status for the job selected.
Posted Status vs Real Status
Terminate a Job or Change Its Status?
Slide 1 - 39
Send a
Force Start Job Event
An event that starts a job immediately, even if its
starting conditions have not yet been met.
While the START JOB command starts only a job
whose starting conditions have already been met,
the FORCE START JOB command starts any job,
even if its starting conditions have not been met.
Send a Comment Event
Associate a comment with a specific job run.
Comments are sent as events and are stored in the
database, permitting you to view the last comment
sent, using the Event Report window on the UNIX Job
Activity Console.
It is useful for documenting job run anomalies.
Send a Set Global Event
Global variables can be used to create job
dependencies. The value of the expression must
evaluate to TRUE for the job dependency to be
satisfied.
Autorep command
autorep sub-commands
-J Job report on job_name. Can be ALL or wildcarded.
-M Machine report on machine_name.
-G Global variable report on global_name.
-s Summary report desired. Default.
-d Detailed report.
-q Query report, providing current JIL definition.
-o Override report for over_num and job_name.
-r Job run report for a specific run of a job.
-t Print time zone in report.
-L Print level for numbers of nesting levels of
Boxes.
-D Dataserver name.
Slide 1 - 43