Autosys commands

Thursday, December 05, 2013

Basic of AutoSys

Qs : What is Autosys ?

Unicenter AutoSys JM is an automated job control system for scheduling, monitoring, and reporting. These jobs can reside on any Unicenter AutoSys JM -configured machine that is attached to a network.

These jobs can be a UNIX script, java program or any other program which can be invoked from shell. Before starting we assume that user has already setup an AutoSys environment.

This environment consists of autosys server and autosys client.


Qs: What are the sysetm components in Autosys?

 

AutoSys System components:

1. Event server 
2. Event processor
3. Remote agent

 

Event Server

  • The event server is a AutoSys database which stores all system information and events as well as all job, monitor, and report definitions.
  • Sometimes this database is also called as a data server, which actually describes a server instance. That is, it is either a UNIX or Windows process, and it is associated data space (or raw disk storage), that can include multiple databases or tablespaces.

 

Event Processor

  • This is main component of the autosys system. This processes all the events it reads from dataserver.
  • The event processor is the program, running either as a UNIX process or as a Windows service that actually runs AutoSys.
  • It schedules and starts jobs.
  • When you start the event processor it continually scans the database for events to be processed. When it finds one, it checks whether the event satisfies the starting conditions for any job in the database.

 

Remote Agent

  • On a UNIX machine, the remote agent is a temporary process started by the event processor to perform a specific task on a remote (client) machine.
  • On a Windows machine, the remote agent is a Windows service running on a remote (client) machine that is directed by the event processor to perform specific tasks.
  • The remote agent starts the command specified for a given job, sends running and completion information about a task to the event server, then exits.
  • If the remote agent is unable to transfer the information, it waits and tries again until it can successfully communicate with the database.

 

Basic functionality of AutoSys 

Below is the diagram which explains the basic functionality, please check the explanation.











 

 

 

 

 

 

 

Explanation

  1. The event processor scans the event server for the next event to process. If no event is ready, the event processor scans again in five seconds.
  2. The event processor reads from the event server that an event is ready. If the event is a STARTJOB event, the job definition and attributes are retrieved from the Event Server, including the command and the pointer (full path name on the client machine) to the profile file to be used for the job. In addition, for jobs running on Windows machines, the event processor retrieves from the database the user IDs and passwords required to run the job on the client machine.
  3. The event processor processes the event. If the event is a STARTJOB, the event processor attempts to establish a connection with the remote agent on the client machine, and passes the job attributes to the client machine.
  4. The event processor sends a CHANGE_STATUS event marking in the event server that the job is in STARTING state.
  5. On a UNIX machine, the inetd invokes the remote agent. On a Windows machine, the remote agent logs onto the machine as the user defined as the job’s owner, using the user IDs and passwords passed to it from the event processor.
  6. The remote agent sends an acknowledgment back to the event processor indicating that it has received the job parameters. The socket connection is terminated. At this point, the event processor resumes scanning the event server database, looking for events to process.
  7. The remote agent starts a process and executes the command in the job definition.
  8. The remote agent issues a CHANGE_STATUS event marking in the event server that the job is in RUNNING state.
  9. The client job process runs to completion, then returns an exit code to the remote agent and quits.

 

Qs : In how many ways we can define Autosys jobs?



Defining autosys job

There are various parameters to define autosys job. Starting from profile, timezone, start time, starting condition and so on.

There are the two methods you can use to create job definitions:
  • Using the AutoSys Graphical User Interface (GUI).
  • Using the AutoSys Job Information Language (JIL) through a command-line interface.

In this tutorial we will use JIL language to create autosys jobs.

JIL stands for Job Information Language. Using this you can instruct autosys to save job definitions. This information saved in autosys database. You can also create a jil file which contains job definition. You can then pass this jil file to autosys.


Qs: What are the job attributes and their JIL keyword in Autosys? Give some examples.


Essential attributes for defining job:

1. Job Name

JIL Keyword : insert_job. Name used to identify the job.

2. Job Type

a. JIL Keyword : job_type. The job type is one of job types: command (c), file watcher (f) or box (b).

3. Owner

a. JIL Keyword : owner

The job owner specifies whose user ID the command will be run under on the client machine. This attribute is automatically set to the user who invoked jil or the GUI to define the job, and cannot be changed except by the edit superuser.

4. command: The command attribute can be the name of any command, executable, UNIX shell script or batch file, and its arguments.

5. machine: This attribute specifies the client machine on which the command should be run.

6. date_condition: If the date_condition is set to 1 (True), which specifies there are date, time, or both, conditions required for starting the job.

7. days_of_week: The days of the week attribute specifies the days on which the job should be run. Starting 2 letters for the day's name are used as the value. we can use 'all' if job is going to run everyday.

8. start_times: Give the time in 24 hours format when job is going to start running.

9. description: Give some job information as comment.

10. std_out_file: it is a standard output log where you can save the job run log.

11. std_err_file: it is a standard error log where you can save the run time error log.

12. alarm_if_fail: if this attribute is set with value 1, user will be notified when job fails.

 

Example :


insert_job: uat_lmc_live_rate_Dly                  job_type: c
command: /apps/ss/userprojects/lmc/live_rate.sh
machine: cri_web_job_queue
owner: citwl@smccuatcriwa06
permission: gx,wx,mx 
date_conditions: 1
days_of_week: mo,tu,we,th,fr 
start_times: "22:00"
description: "Live Rate Job"
std_out_file: /local/ss/cit/userprojects/log/lmc/lmc_liverate.stdout 
std_err_file: /local/ss/cit/userprojects/log/lmc/lmc_liverate.stderr 
alarm_if_fail: 1


Qs: How to add job definition to JIL library? How to schedule jobs in Autosys?


Job definition using JIL code as given above and
the below command will add “echoJob” job to autosys databse.


jil < jobname.jil


Qs: What are the differnent job Status in Autosys ?

 

STATUS on output screen 

(abbreviated with starting 2 letters)

ACTUAL STATUS               

Meaning

RU
RUNNING
Running
ST
STARTING
Starting
SU
SUCCESS
Success
FA
FAILURE
Failure
TE
TERMINATED
Terminated
OI
ON_ICE
On Ice
IN
INACTIVE
Inactive
AC
ACTIVATED
Activated
RE
RESTART
Restart
OH
ON_HOLD
On Hold
QW
QUE_WAIT
Queue Wait
RD
Refresh
Dependencies
RF
Refresh
Filewatcher












1 comment:

odms said...

nice blog...thanks for sharing information with us..

tops security services in hyderabad