You are on page 1of 132

Tutorial

5.3

AutoSys

This documentation and related computer software program (hereinafter referred to as the "Documentation") is for the end user's informational purposes only and is subject to change or withdrawal by Computer Associates International, Inc. ("CA") at any time. THIS DOCUMENTATION MAY NOT BE COPIED, TRANSFERRED, REPRODUCED, DISCLOSED OR DUPLICATED, IN WHOLE OR IN PART, WITHOUT THE PRIOR WRITTEN CONSENT OF CA. THIS DOCUMENTATION IS PROPRIETARY INFORMATION OF CA AND PROTECTED BY THE COPYRIGHT LAWS OF THE UNITED STATES AND INTERNATIONAL TREATIES. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION "AS IS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THIS DOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESS INTERRUPTION, GOODWILL OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. THE USE OF ANY PRODUCT REFERENCED IN THIS DOCUMENTATION AND THIS DOCUMENTATION IS GOVERNED BY THE END USER'S APPLICABLE LICENSE AGREEMENT. The manufacturer of this documentation is Computer Associates International, Inc. Provided with "Restricted Rights" as set forth in 48 C.F.R. Section 12.212, 48 C.F.R. Sections 52.227-19(c)(1) and (2) or DFARS Section 252.227.7013(c)(1)(ii) or applicable successor provisions. 19972000 Computer Associates International, Inc., One Computer Associates Plaza, Islandia, New York 11788-7000. All rights reserved. All product names referenced herein belong to their respective companies.

Contents

Preface
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-1 About the AutoSys Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-2 Taking the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-2 Lesson Summaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-3 Conventions Used in the Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface-4

Chapter 1: AutoSys Environment


AutoSys Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 AutoSys Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 Defining Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 AutoSys Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AutoSys Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Software Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AutoSys Event Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 1-3 1-3 1-4

Event Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 Working Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 AutoSys Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 AutoSys Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 AutoSys Database Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 AutoSys Commands and Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Monitors and Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9

Contents

Chapter2: AutoSys Jobs


Job Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Saving Job Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Running Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Job Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 2-2 2-3 2-4 2-6 2-6

File Watcher Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7 Box Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8 Job States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11

Chapter3: Job Streams


Job Streams Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 Example Job Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Date/Time and Job Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 File Watcher Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Box Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Advanced Box Job Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10

Chapter4: Defining and Running Jobs using the GUI


AutoSys GUI Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Starting the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 GUI Control Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 AutoSys Job Definition Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 Job Definition Dialog Control Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 Job Definition Dialog Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 Defining a Command Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 Running a Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 Send Event Dialog and Job Activity Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8

ii

AutoSys Tutorial

Defining Jobs with Starting Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 Specifying Date and Time Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 Date/Time Options Dialog Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 Specifying Job Dependency Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 Defining a File Watcher Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15 Initiating the Job Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19 Observing the Job Streams Progression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19 Defining a Box Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20 Removing Jobs and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25 Deleting Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25 Deleting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28

Chapter5: Defining and Running Jobs using JIL


Job Information Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 JIL Sub-commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 Basic JIL Attribute Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 JIL Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining a Command Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Running a Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Jobs with Starting Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Date and Time Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5-5 5-7 5-8 5-8

Specifying Job Dependency Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10 Removing Jobs and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 Deleting Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 Deleting Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15

Contents

iii

Chapter6: Monitoring and Managing AutoSys


Operator Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 Starting the Operator Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Job Activity Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 Job List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 Currently Selected Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 Control Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Action Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Send Event Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7 Control Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9 Alarm Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 Exit Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 Job Selection Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 Specifying a Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12 Sorting the Specified Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13 Setting the Job Selection Criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 AutoSys Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15 Alarm Manager Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15 Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17 Alarm List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17 Currently Selected Alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18 Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18 Alarm Selection Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19 Select by Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19 Select by State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 Select by Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22

iv

AutoSys Tutorial

Chapter7: Queuing and Load Balancing


Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Real Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Machines to AutoSys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Machine Load (max_load) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 7-2 7-2 7-2 7-3

Specifying Relative Processing Power (factor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 Using max_load and factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 Defining Real Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 Deleting Real Machine Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 Defining Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 Job Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7 Load Balancing using Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8 Load Balancing using a List of Real Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8 Example of Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9 Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 See Also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10

Contents

Preface

Welcome to the world of AutoSys, the scheduling and operations automation software for distributed environments. This manual contains a tutorial in seven lessons to get you started using AutoSys quickly and efficiently.

Related Documents
The lessons in this tutorial introduce you to many AutoSys concepts and features. These concepts and features are described in more detail in other AutoSys documentation. Therefore, at the end of each lesson there is a See Also section that directs you to more in-depth discussions on the topics covered in that specific lesson. These references are to one or more of the manuals listed below. For UNIX, the following documentation is provided in addition to this AutoSys Tutorial:
I

AutoSys User Manual for UNIX describes how to use AutoSys, and how to optimize job management in your distributed computing environment. AutoSys Installation Guide for UNIX describes how to install the AutoSys for UNIX software, how to install the AutoSys Database, and how to enter license manager keys.

For Windows NT, the following documentation is provided in addition to this AutoSys Tutorial:
I

AutoSys User Manual for Windows NT describes how to use AutoSys, and how to optimize job management in your distributed computing environment. The AutoSys Installation Guide for Windows NT describes how to install the AutoSys for Windows NT software, how to install the AutoSys Database, and how to enter license manager keys. AutoSys Help, which you can open from your AutoSys program group. The on-line help describes how to configure AutoSys, including setting up high availability options, and how to use the AutoSys Administrator and the Job Profiles Manager.

Preface-1

About the AutoSys Tutorial

About the AutoSys Tutorial


This tutorial is intended for systems administrators and operations personnel who will be responsible for defining, monitoring, and managing jobs run by AutoSys. This manual assumes familiarity with the UNIX and/or NT operating systems, and it assumes that AutoSys has been installed and running on the machine that you will use when doing the tutorial exercises. Before beginning this tutorial, you should install, start, and test the AutoSys software.
Note:

For information on installing AutoSys on your platform, see the AutoSys Installation Guide for your platform.
0

Taking the Tutorial

This tutorial is structured into seven lessons that contain the basic information you need to begin using AutoSys. The seven lessons have been designed so that the more complex topics are built on the understanding of less complicated ones. Also, information is presented in a logical sequence, so you can begin using AutoSys as quickly as possible. As a result, you should take each lesson in the order provided.

Estimated Times
Each lesson in the tutorial has been assigned an estimated time to complete. However, you might complete some lessons more quickly, or spend more time on topics that are of special interest to you. On the average, the tutorial should take about five hours to complete, and, after that time, you can be using AutoSys confidently.

Concepts and Skills


Each lesson in the tutorial presents information either in a conceptual fashion or in a conceptual and hands-on fashion. As you might expect, you will need to conceptually understand some of the basic concepts of AutoSys before you actually begin defining and running jobs on the system. For this reason, the first three lessons contain only conceptual information. The next three lessons provide conceptual information as well as hands-on tasks for you to accomplish. The last lesson has only conceptual information. Once you read the first three lessons, you will be ready to work on the system and perform the tasks in the next three lessons.

Preface-2

AutoSys Tutorial

About the AutoSys Tutorial

Lesson Content and Flow


The lessons in this tutorial have been designed and structured with the following audiences in mind:
I

Lessons 1 through 5 are directed toward individuals responsible for defining and running AutoSys jobs. Lessons 6 and 7 are directed toward individuals responsible for configuring and administering AutoSys.

However, all seven lessons can benefit both AutoSys operator and administrator personnel.

Lesson Summaries
Each lesson is briefly summarized below.

Lesson 1: AutoSys Environment


Provides basic information about the AutoSys environment and how AutoSys functions. The following topics are covered: AutoSys Definition, AutoSys Machines, AutoSys Instances, Software Components, Working Environment, and AutoSys Commands.

Lesson 2: AutoSys Jobs


Provides basic information about AutoSys jobs and their fundamental characteristics. The following topics are covered: Job Definitions, Saving Job Definitions, Starting Parameters, Running Jobs, Job Types, and Job States.

Lesson 3: Job Streams


Provides basic information about job streams and how to develop them. The following topics are covered: Job Streams Definition and Example Job Streams.

Lesson 4: Defining and Running Jobs using the GUI


Describes how to define and run jobs using the AutoSys Graphical User Interface (GUI). The following topics are covered: GUI Control Panel, Job Definition Dialog, Defining a Command Job, Running a Job, Defining a Dependent Job, Defining a File Watcher Job, and Defining a Box Job.

Lesson 5: Defining and Running Jobs using JIL


Describes how to define and run jobs using the Job Information Language (JIL). The following topics are covered: Job Information Language, JIL Syntax, Defining a Command Job, Running a Job, and Defining a Dependent Job.

Preface-3

Conventions Used in the Tutorial

Lesson 6: Monitoring and Managing AutoSys


Describes how to access the AutoSys features used for monitoring and managing AutoSys jobs and alarms. The following topics are covered: Operator Console, Job Activity Console, Job Selection Dialog, AutoSys Alarms, Alarm Manager, and Alarm Selection Dialog.

Lesson 7: Queuing and Load Balancing


Describes how to define real and virtual machines in order to balance job loads across physical machines. The following topics are covered: Real Machines, Virtual Machines, and Load Balancing.

Conventions Used in the Tutorial


The conventions used in this guide for syntax statements and instructions are as shown in the following table: Convention bold courier Definition Command names, command option and keyword names, and attribute and value names are in bold courier. Non-literal variables, or words that stand for values that you fill in, are in bold italics. Sample output text and filenames are in regular courier. Curly braces indicate that you must choose at least one of the enclosed options. Do not include the braces themselves.

bold italic

courier { }

[ ]

Square brackets indicate that you may choose zero, one, or more of the enclosed options. Do not include the brackets themselves. A vertical bar indicates that you may select only one of the options shown. A comma indicates that you may choose as many of the options shown as you want, separating your choices with commas. You must include the commas in the command or attribute you type.

Preface-4

AutoSys Tutorial

Conventions Used in the Tutorial

Convention < >

Definition Less than/greater than pointed brackets indicate a key to be pressed. <Control+C> indicates that both the Control key and the C key should be pressed simultaneously.

For example, the syntax statement for the autorep command is as follows: autorep {-J job_name | -M machine_name | -G global_name} [-s | -d | -q | -o over_num] [ -r run_num] [-L print_level] [-t] [-D data_server:database | -D TNSname] The autorep command itself is typed exactly as shown. The three main options, -J job_name, -M machine_name, and -G global_name are enclosed in curly braces and are separated by vertical bars. Therefore, one and only one of them must be chosen. The variable job_name must be replaced by an actual job name. The four options -s, -d, -q, and -o are separated by a vertical bar in square brackets, indicating that none or one may be specified. The -L and -D options, and their arguments, are also optional.

Preface-5

Lesson

AutoSys Environment

This first lesson introduces you to AutoSys-specific terminology while providing basic information about the AutoSys environment. Topics to be Covered:
I I I I I I I

Topic Approach: Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual

AutoSys Definition AutoSys Jobs AutoSys Machines AutoSys Instances Software Components Working Envirionment AutoSys Commands and Monitors

Estimated Time:

25 Minutes

AutoSys Definition
AutoSys is an automated job management system that lets you schedule, monitor, and report on jobs that run on any licensed AutoSys client machines attached to your network.

AutoSys Jobs
In the AutoSys environment, a job is a single action that can be performed on a valid AutoSys client machine. On UNIX, this action can be any single command or shell script, and on NT, this action can be any single command, executable, or batch file. In addition, job definitions include a set of qualifying attributes.

AutoSys Environment 1-1

AutoSys Machines

Defining Jobs
Using AutoSys utilities, you can define a job by assigning it a name and specifying the attributes that describe its associated behavior. These specifications make up the AutoSys job definition. Below are the two methods you can use to create job definitions:
I I

The AutoSys Graphical User Interface (GUI) The AutoSys Job Information Language (JIL)

AutoSys Graphical User Interface (GUI)


The AutoSys GUI allows you to interactively set the attributes that describe when, where, and how a job should run. You create job definitions using the GUI Control Panel and the dialogs you can launch from it. The fields in the GUI dialogs correspond to the AutoSys JIL sub-commands and attributes.

Job Information Language (JIL)


JIL is a specification language, with its own syntax, that is used to describe when, where, and how a job should run. When you enter the jil command you get the jil command prompt, at which you can enter the job definitions one line at a time using this special language. When you exit jil, the job definition is loaded into the AutoSys database. Alternatively, you can enter the definition as a text file and re-direct the file to the jil command. In this case, the jil command activates the language processor, interprets the information in the text file, and loads this information in the AutoSys database.

AutoSys Machines
From a hardware perspective, the AutoSys environment is composed of the following two types of machines attached to a local area network (or LAN): Server MachineThe AutoSys server is the machine(s) on which the Event Processor and/or the Event Server (database) reside. In a basic configuration, both the Event Processor and the Event Server reside on the same machine. Client Machine(s)The AutoSys client is the machine on which the Remote Agent software resides, and where AutoSys jobs are to be run. This can be on the AutoSys server and/or on separate physical client (or agent) machine(s).

1-2

AutoSys Tutorial

AutoSys Instance

AutoSys Instance

An AutoSys instance is one licensed version of AutoSys software running as an AutoSys server, or as an AutoSys server/agent, on one or more machines. An instance uses its own Event Processor and Event Server and operates independently of other AutoSys instances. An instance is defined by the following:
I I I

At least one Event Server. The instantiation of an Event Processor. The value of the AUTOSERV variable, which is the three-letter instance ID.

You might want to install multiple instances of AutoSys to accomplish the following:
I I

Separate the processing of one department from that of another department. Separate test and development environments from production processing.

Software Components
From a software perspective, the AutoSys environment is composed these main components (as shown in Figure 1-1):
I I I I

Event Server (AutoSys database) Event Processor Remote Agent Console Utilities

The Event Processor and the Event Server constitute the server, and the Remote Agent(s) constitute the client(s), and they interact with each other based on a true client/server model. The AutoSys Event Server, Event Processor, and Remote Agent(s) can reside on the same machine. If this is the case, the server machine also acts as a client machine. The Console Utilities are used for defining and maintaining AutoSys instances and jobs; what is included with these utilities is platform-specific.

AutoSys Environment 1-3

Software Components

Ethernet Server Machine Client Machines AutoSys Database Event Processor Remote Agent

Remote Agent

Remote Agent

Figure 1-1 AutoSys Software Components

AutoSys Event Server


The AutoSys Event Server is a database containing information about AutoSys, as well as events and job and calendar definitions.

Events
AutoSys is completely event-driven. That is, every action occurring in the AutoSys environment is considered a unique event. The Event Server records important data about each event, and the Event Processor interprets and processes all the events it reads from the Event Server. In the AutoSys environment, an event can be one of the following:
I

A command internally generated by the Event Processor which controls AutoSys job processing. A runtime command that is manually sent to the Event Processor using the AutoSys sendevent command or the AutoSys Send Event dialog (part of the Operator Console discussed later in this tutorial). Examples of these types of events would be STARTJOB and JOB_ON_HOLD. An alarm that notifies operations personnel of situations that require their attention. An example of this type of event would be JOB_FAILURE.

1-4

AutoSys Tutorial

Software Components

Job and Calendar Definitions


A job definition contains the instructions for a job, including when, where, and how it should be run. A calendar definition can be associated with a job to determine what days a job should and/or should not be run. To create calendar definitions, use the AutoSys Graphical Calendar Facility (which you can open from the Job Definition dialog, discussed later in this tutorial).

Event Processor
The Event Processor interprets and processes all the events it reads from the Event Server. The Event Processor 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. For each event, it determines whether or not the starting conditions for a particular job have been satisfied. If they have, it proceeds to do the following (as illustrated in Figure 1-2): 1. Determine what actions are to be taken. The actions to be taken might be the starting or stopping of a job, checking for resources, monitoring existing jobs, or initiating corrective procedures. Instructs the appropriate Remote Agent to perform these actions.

2.

High Availability
You can configure AutoSys to run with Dual Event Servers and a Shadow Event Processor as a means of obtaining high availability and redundancy in the system.

Remote Agent
The Remote Agent is a temporary process started by the Event Processor on a client, or agent, machineit is started so a specific action can be taken. The Remote Agent performs its processing as follows (as illustrated in Figure 1-2):
I I I I

Starts the job Runs the job Returns job status or completion information to the Event Server Exits

If the Remote Agent is unable to return information to the Event Server (for example, if it is down), it waits and tries again later.

AutoSys Environment 1-5

Working Environment

Ethernet Server Machine Client Machines AutoSys Event Server polls Event Server Event Processor Remote Agent

Remote Agent

Event Processor - event found - starting conditions met - start up Remote Agent

Remote Agent - start up - run job - return job status - exit

Figure 1-2 Running a Job

Working Environment
The behavior of the Event Processor, Event Server, and Remote Agent are controlled by AutoSys environment variables and the AutoSys configuration parameters. For example, the configuration parameters specify which Event Server the Event Processor and the Remote Agent(s) should connect to for an instance, and the instance name is specified by the AUTOSERV environment variable. The AutoSys database also has its own associated environment variables and configuration file.

1-6

AutoSys Tutorial

Working Environment

AutoSys Environment Variables


These are the AutoSys environment variables:
I I

AUTOSYS Specifies the directory for the AutoSys software. AUTOUSER Specifies the directory containing user files, which, depending on the platform, can include configuration files, Event Processor output files, archive files, and sound files. AUTOSERV Specifies the unique, three-lettered name of a single instance of AutoSys running on a single or multiple machines.
1

AutoSys Configuration Parameters


The AutoSys configuration parameters specify the information for and control the behavior of the AutoSys components. At installation, AutoSys is configured with default settings. You can keep the installation defaults or you can modify many of the settings. On UNIX, you can modify these parameters, which are located in the $AUTOUSER/config.$AUTOSERV configuration file. On NT, you can modify these parameters using the AutoSys Administrator, which is installed in your AutoSys program group as part of the AutoSys Console Utilities.

AutoSys Database Variables


The AutoSys Event Server can be configured for a Sybase, Oracle, or (for NT) Microsoft SQL Server database. Refer to the installation information and release notes provided with your platform for details on configuring your database for AutoSys.

Sybase
For bundled and unbundled Sybase, you must define the SYBASE environment variable to specify where the Sybase directory is located. The Sybase directory contains the interfaces file (for UNIX) or the SQL.INI file (for NT), which specifies the location of the database. In addition, the DSQUERY environment variable defines the name of the Sybase AutoSys database.

Oracle
For Oracle, ensure that the tnsnames.ora file is present and properly configured. This file specifies where the Oracle dataserver is located. On UNIX, the tnsnames.ora file is usually in $TNS_ADMIN/tnsnames.ora. On NT, this file is usually in \ORANT\NETWORK\ADMIN\TNSNAMES.ORA.

AutoSys Environment 1-7

AutoSys Commands and Monitors

Microsoft SQL Server


For Microsoft SQL Server, you must install the appropriate Microsoft SQL Server client utilities on each AutoSys Event Processor and Remote Agent machine, and ensure that there is database connectivity between the Event Server, Event Processor, and Remote Agent machines.

AutoSys Commands and Monitors


There are several commands unique to AutoSys that can be used to control, configure, and report on system behavior. In addition, you can monitor AutoSys processes and generate reports in various formats using either the AutoSys GUI dialogs or commands.

Commands
You enter AutoSys commands with the appropriate arguments at the UNIX prompt or at the AutoSys Instance Command Prompt on NT. You can also use some of these commands in programs run by AutoSys to programmatically control and monitor AutoSys at runtime. Below are examples of AutoSys commands:
I

chk_auto_up Inspects the AutoSys environment variables and configuration files, then determines if the Event Server and the Event Processor are running. autoping Verifies that the AutoSys client machine(s) are properly configured and can communicate successfully. It also verifies that the Remote Agent (client software) is functioning correctly. autorep Reports information about the status of jobs, job runs, machines, and machine status. It also reports information about job overrides and global variables.
1

Monitors and Reports


Monitors provide you with a real-time view of the system. Reports (also called Browsers) provide you with the ability to examine historical information about job runs using a variety of reporting views. Monitors and reports retrieve information from the AutoSys database and allow you to filter and screen only the information you are interested in from this vast collection of data. You can define monitors and reports using the AutoSys GUI (select the Monitor/ Browser button from the Control Panel), or by using JIL statements. The monitors and reports only have to be defined to AutoSys oncethey can then be set to run automatically according to a schedule, or they can be set to wait for on-demand execution.

1-8

AutoSys Tutorial

Review

You can monitor job activity using the Job Activity Console of the Operator Console; you can monitor the activity of the Event Processor using the autolog e command.

Operator Console
The Operator Console is a collection of dialogs that provide a sophisticated method of monitoring AutoSys jobs in real-time. This feature lets you view any jobs that are defined to AutoSys, whether they are currently active or not. You can select any job and view more detailed information about it.

Review
I

AutoSys is an automated job management system that lets you schedule, monitor, and report on jobs that run on any licensed AutoSys client machines attached to a network. A job is defined as a single action that can be taken on a valid AutoSys client machine. From a hardware perspective, AutoSys is composed of two types of machines: server machine and client machine(s). From a software perspective, the AutoSys environment is composed of four major components: Event Server (database), Event Processor, Remote Agent(s), and Console Utilities. The Event Server stores job definitions and event information. The Event Processor is a server process that continually polls the Event Server for events that need to be processed. The Remote Agent is a temporary process started by the Event Processor on a client machine to process specific tasks. The AutoSys environment is controlled by environment variables and configuration parameters. The AutoSys database (Event Server) also has its own environment variables and configuration files. There are several AutoSys commands that can be used to control, configure, and report on operations and system behavior. There are GUI dialogs and AutoSys commands that you can use to monitor and report on AutoSys job activity.

I I

AutoSys Environment 1-9

See Also

See Also
I

For information on configuring your database, see the installation information provided with your platform. For more information on the AutoSys database (Event Server) refer to the AutoSys User Manual for your platform. For information on modifying AutoSys configuration parameters, including setting up your AutoSys to use Dual Event Servers and a Shadow Event Processor, refer to the AutoSys User Manual for your platform. For information on AutoSys commands, refer to the AutoSys User Manual for your platform. For information on monitoring jobs and creating reports, refer to the AutoSys User Manual for your platform. For information on using the Operator Console, refer to Lesson 6 in this tutorial, and then refer to the AutoSys User Manual for your platform.

1-10

AutoSys Tutorial

Lesson

AutoSys Jobs

This lesson provides basic information about AutoSys jobs and their fundamental characteristics. Topics to be Covered:
I I I I I I

Topic Approach: Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual

Job Definitions Saving Job Definitions Starting Conditions Running Jobs Job Types Job States

Estimated Time:

30 Minutes

Job Definitions
An AutoSys job is a single action that can be taken on a valid AutoSys client machine, by the Remote Agent. A job performs a particular action based on a set of instructions called a job definition. These instructions are essentially attributes of the job that specify when, where, and how the job should be run. You can create a job definition in one of the following ways (as in Figure 2-1):
I I

Generated interactively using the AutoSys Graphical User Interface (GUI). Entered either into a text file and then redirected using the AutoSys Job Information Language (JIL), or at the jil prompt.

AutoSys Jobs 2-1

Saving Job Definitions

GUI - Job Definition Dialog

JIL Job Definition Text

JIL sub-command Attribute statements ... ... ...

Job Definition Figure 2-1 Creating Job Definitions

Saving Job Definitions


Once a job definition has been created, it must be saved to the Event Server (database). The job definitions are saved to the database in one of the following ways (as illustrated in Figure 2-2):
I

If you define a job using the GUI, the job is saved when you click Save in the Job Definition dialog. If you define a job by creating a job definition text file, the job is saved when the text file is re-directed into the AutoSys jil command. Note that if you define a job at the jil prompt, the definition is saved to the database when you exit jil.

2-2

AutoSys Tutorial

Starting Conditions

Job Definition

GUI - Job Definition Dialog

JIL Job Definition Text File


JIL sub-command Attribute statements ... ... ...

Saved to the Event Server

Save

jil < text_file_name

Stored in the Event Server


AutoSys Event Server (database) Server Machine

Figure 2-2 Saving Job Definitions

Starting Conditions
A jobs starting conditions tell the Event Processor when to run a job. These conditions can be based on the following:
I

Date and time conditions Specify certain dates and/or times to run or not to run a job. Job dependency conditions Specify that certain job events occur before the job can be run.

Starting conditions are defined by attribute statements within a job definition, regardless of whether you use the GUI or JIL to specify them. If you define a job using the GUI, you specify its date and time conditions in the Date/Time Options dialog. You set its job dependency conditions in the Job Definition dialog.

AutoSys Jobs 2-3

Running Jobs

If you define a job using JIL, you specify its date and time conditions, as well as its job dependency conditions, using attribute statements. The following are examples of date and time conditions:
I

days_of_week Specifies days on which to run the job. start_times Specifies times of the day on which to run the job. run_window Specifies a time span in which the job is allowed to start.

The following are examples of job dependency conditions:


I

success(job_name) Specifies to run the job upon the successful completion of the indicated job. failure(job_name) Specifies to run the job if the indicated job fails. notrunning(job_name) Specifies to run the job if the indicated job is not running. done(job_name) Specifies to run the job if the indicated job has completed running; its status can be SUCCESS, FAILURE, or TERMINATED.

Running Jobs
A job is started based on its starting conditions.
I

Jobs with starting conditions If a job has starting conditions, the Event Processor starts it automatically when the starting conditions have been satisfied. Figure 2-3 illustrates this process. Jobs with no starting conditions If a job does not have starting conditions, you must start it manually. You must have the correct permissions to start a job.

Figure 2-4 illustrates these two methods of starting a job. Using the GUI, you can send a STARTJOB event from the Send Event dialog. Using AutoSys commands at the command prompt, you can issue a sendevent -E STARTJOB -J job_name command to start a job. You can use either of these methods, regardless of how the job definition was entered into the AutoSys database.

2-4

AutoSys Tutorial

Running Jobs

Job with Starting Conditions

Server Machine polls Event Server Event Processor Event Processor - starting conditions met - run job

Job Runs Figure 2-3 Job Runs Automatically

Job with No Starting Conditions GUI - Send Event Dialog

sendevent -E STARTJOB -J job_name

STARTJOB event press Execute

Job Runs Figure 2-4 Job Runs Manually

AutoSys Jobs 2-5

Job Types

Job Types
There the three types of AutoSys jobs: Command, File Watcher, and Box.

Command Jobs
The Command Job is most commonly thought of as a job. When a Command Job is run, the specified command is executed on a client machine, as illustrated in Figure 2-5. When the command has completed, the executing Remote Agent sends an AutoSys event (such as SUCCESS or FAILURE) and other completion information back to the Event Server. You can assign to a job a profile that specifies user-defined environment variables needed to run the job. If the profile job attribute is assigned to a job, the Remote Agent will source the assigned profile file before executing the job. Server Machine

Event Processor - starting conditions met - start Command Job Command Job - JobA on Client Machine #1

Client Machine #1 - start up Remote Agent - execute command - write value of exit code to AutoSys Event Server - Remote Agent exits Client Machine #2

Client Machine #3

Figure 2-5 Running Command Jobs

2-6

AutoSys Tutorial

Job Types

File Watcher Jobs


A File Watcher Job starts a process on a client machine that monitors the creation and size of a specific file. When that file reaches a certain minimum size, and is no longer growing, the File Watcher Job completes with a SUCCESS status. Figure 2-6 illustrates this process. File Watcher Jobs provide a means of integrating events external to AutoSys into the processing of AutoSys jobs. For example, a file needs to be downloaded from a mainframe, and it is expected to arrive after 2:00 a.m. When it arrives, a batch job is to be run to process it, and this in turn could start a whole sequence of jobs. That is, the File Watcher Job could start the processing of several other dependent jobs in a job stream.
.

Server Machine

Event Processor - starting conditions met - start File Watcher Job

Client Machine #1

Client Machine #2 File Watcher Job - JobW on Client Machine #2 start up Remote Agent watch for file monitor file size file reaches minimum size and is stable (no longer growing) - Return successful job completion status - Remote Agent exits

Client Machine #3

Figure 2-6 Running File Watcher Jobs

AutoSys Jobs 2-7

Job Types

Box Jobs
A box is a container of jobs with like starting conditions, either date/time conditions or job dependency conditions. Figure 2-7 illustrates the running of jobs in a box. Use boxes to group jobs with like scheduling parameters, not as means of grouping jobs organizationally. For example, if you have a number of jobs that run daily at 1:00 a.m., you could put all these jobs in a box and assigning a daily start condition to the box. (In contrast, a variety of account processing jobs with diverse starting conditions should not be grouped in the same box.) Server Machine

Event Processor - starting conditions met - run Box Job Box Job - JobA on Client Machine #1 - JobB on Client Machine #2 - JobC on Client Machine #3 ...

Client Machine #1 - start up Remote Agent - execute command from JobA - write value of exit code to AutoSys Event Server - Remote Agent exits Client Machine #2 - start up Remote Agent - execute shell script from Job - write value of exit code to AutoSys Event Server - Remote Agent exits Client Machine #3 - start up Remote Agent - execute command from JobC - write value of exit code to AutoSys Event Server - Remote Agent exits

- complete Box Job and write exit status when the contained jobs complete

Figure 2-7 Running Box Jobs


Note:

Jobs in boxes can be started only when their parent box is running. However, once a contained job starts running, it completes, even if the box is later stopped for some reason.

2-8

AutoSys Tutorial

Job States

Job States
At every point in processing, a job has what is called its current status or state. This status is stored in the Event Server and is kept track of by AutoSys at all times. Figure 2-8 illustrates the states that simple jobs go through. The value of a jobs status is used to determine when to start other jobs that are dependent on a particular job (or jobs). This value is displayed in the Job Report generated by the AutoSys autorep command, and it is displayed in the AutoSys Operator Console (in the Job Activity Console windows Status field). These are the status values a job can have:
I

STARTING The Event Processor is starting up the Remote Agent. The job is in the process of coming up. RUNNING The job is running. INACTIVE The job has not been processed; the job has never been run, or its status was intentionally altered to turn off its previous completion status. SUCCESS The job exited with an exit code equal to or less than the maximum exit code for success. FAILURE The job exited with an exit code greater than the maximum exit code for success. TERMINATED The job terminated while in the RUNNING state. RESTART The job was unable to start (or failed) due to hardware or software problems, and has been scheduled to restart. ACTIVATED The top-level box that this job is in is now in the RUNNING state, but the job itself has not yet started. QUE_WAIT The job can logically run (i.e., all the starting conditions have been met), but there are not enough machine resources available at the time. ON_ICE This job is removed from all conditions and logic, but is still defined to AutoSys. Operationally, this is like deactivating the job, which will remain on ice until it receives the JOB_OFF_ICE event. ON_HOLD This job is on hold and will not be run until it receives the JOB_OFF_HOLD event. In addition, while this job remains in the ON_HOLD status, dependent, downstream jobs will not be run.

I I

I I

AutoSys Jobs 2-9

Review

Point in Processing Event Processor Reads Event Starting Conditions for a Job Met Start Up Remote Agent Remote Agent Starts Up Run Job Job is Running Job Completes Inspect Exit Code Return Status and Exit Code to AutoSys Database Remote Agent Exits

Event Generated by

Current Job State

Event Processor

STARTING

Remote Agent

RUNNING

Remote Agent

SUCCESS or FAILURE

Figure 2-8 Basic Job States

Review
I

An AutoSys job is a single action that can be taken on a valid AutoSys agent machine, such as executing a command or watching for a file. A job performs a particular action based on a set of instructions called a job definition. A job definition can be created using the AutoSys GUI (Job Definition Dialog) or using JIL. Once a job definition has been created, it must be saved to the Event Server. A jobs starting parameters tell the Event Processor when to run a job. These parameters can be of two types: date and time conditions and/or job dependency conditions. If a job does not have starting conditions, you must start it manually, either using the Send Event dialog or the sendevent command. There are three types of AutoSys jobs: Command, Box, and File Watcher. When a Command Job is run, the resulting action is the execution of a specified command by a Remote Agent on a client machine.

I I

I I

2-10

AutoSys Tutorial

See Also

A File Watcher Job starts a process on an agent machine that monitors the creation and size of a specific operating system file. A Box Job is an abstraction that defines a container of other jobs. This container provides a way to group jobs based on similar or related starting conditions. The box itself performs no actions, although it must be running in order for the jobs it contains to run. At every point in processing, a job has what is called its current status or state. This status is stored in the AutoSys database so that AutoSys can keep track of all jobs states. The value of a jobs status is used to determine when to start other jobs that are dependent on a particular job (or jobs).

See Also
I

For more information on AutoSys jobs, see Chapter 3, AutoSys Jobs, and Chapter 4, Job Attributes, in the AutoSys User Manual for your platform. For information on defining jobs using the AutoSys GUI dialogs, see Lesson 4, in this tutorial, and then refer to the AutoSys User Manual for your platform. For more information on defining jobs using JIL, see Lesson 5, in this tutorial, and then refer to the AutoSys User Manual for your platform. For information on using profiles to set environment variables for jobs, see Chapter 3, AutoSys Jobs, in the AutoSys User Manual for your platform. For information on running jobs, and job executing permissions, refer to Chapter 2, AutoSys Security, in the AutoSys User Manual for your platform. For information on the sendevent command, refer to its entry in the AutoSys User Manual for your platform.

AutoSys Jobs 2-11

Lesson

Job Streams

This lesson provides basic information about job streams and how to develop them. Topics to be Covered:
I I

Topic Approach: Conceptual Conceptual

Job Streams Example Job Streams

Estimated Time:

30 Minutes

Job Streams Definition


A job stream (or flow) refers to the logic of how related AutoSys jobs are run. Much of the logic inherent in a job stream is based on the starting conditions of the jobs in the stream. A jobs starting conditions tell the Event Processor when to run a job. These conditions can be the following types:
I

Date and time conditions specifies certain dates and/or times to run or not to run a job. Job dependency conditions specifies that certain job events occur before the job can be run.

In addition, jobs in a box are controlled by the parent Box Jobs starting conditions, and jobs in a box and only be started when the parent Box Job is running. The following are examples of ways jobs can be related in a job stream:
I

A Command job can be dependent on the successful completion of another job that has date and time starting conditions. A Command job can be dependent on a particular condition being satisfied for another job before it will run, such as the other job must have a SUCCESS or FAILURE completion status.

Job Streams 3-1

Example Job Streams

A File Watcher Jobs successful completion is dependent on the creation and size of a particular file. In addition, other jobs can be dependent on the SUCESS of FAILURE of a File Watcher job. A Box Jobs successful completion is dependent on the successful completion of all the jobs inside the box (this is the default behavior for a Box Job). Note that the jobs in a box that have no other starting conditions will run as soon as the box starts.

The above dependencies become more sophisticated when, for example, you implement one of the following job dependencies:
I

A job is dependent on conditions being satisfied for several other jobs, such as SUCCESS for one and the FAILURE of another. A job within a Box Job is dependent on conditions being satisfied for one or more other jobs inside the box.

Example Job Streams


This section presents four job streams, with explanations. These examples will help you understand how to logically structure job dependencies and job streams using AutoSys.

Date/Time and Job Dependencies


For example, you might create job definitions and a job stream based on the following logic:
I

The job_backup Command Job has date and time conditions specified for its starting conditions. This job is to be run every day of the week at 1:01 a.m. For example, this job might perform regular backups of the system. The job_clean Command Job has a job dependency condition specified for its starting parameter. It will run only on the successful completion of job_backup. This job might delete certain operating system or log files that have become too large, in order to save space on the system.

This logic is illustrated in Figure 3-1.

3-2

AutoSys Tutorial

Example Job Streams

Job Definitions
job_backup 1:01 a.m. Daily Perform Backup job_clean success(job_backup) Delete Files

Job Stream
Date/Time Conditions Met Start job_backup

SUCCESS job_backup

Job Dependency Condition Met

Start

job_clean

SUCCESS job_clean

Figure 3-1 Command Job Stream

File Watcher Jobs


In this example job stream, a File Watcher Job is used to watch for an incoming mainframe file. Note that this example would run on a UNIX machine. The job definitions and job stream are based on the following logic:
I

The job_Fwatch File Watcher Job has date and time conditions specified for its starting conditions. This job is to be run every day of the week at 2:00 p.m. It watches for a file arriving from a mainframe. The job_Fwatch job will check every 15 seconds for the creation of the incoming file. Once the file has arrived, job_Fwatch will monitor the files size to see if it has stabilized (it has maintained a specified size in bytes for at least 15 seconds). When both of these conditions are met, job_Fwatch will notify the Event Server and complete with a SUCCESS status. The job_parse Command Job has a job dependency condition specified for its starting parameter. It will run only on the successful completion of the job named job_Fwatch. This job parses the newly received file and formats certain data into a report.

Job Streams 3-3

Example Job Streams

The job_print Command Job has a job dependency condition specified for its starting parameter. It will run only on the successful completion of the job_parse job. The job_print job prints the report created by job_parse.

This logic is illustrated in Figure 3-2.

Job Definitions
job_Fwatch 2:00 p.m. Daily Watch for file job_parse success(job_Fwatch) Generate Report job_print success(job_parse) Print Report

Job Stream
Date/Time Conditions Met Start job_Fwatch File from Mainframe

SUCCESS job_Fwatch

Job Dependency Condition Met

Start

job_parse

SUCCESS job_parse

Job Dependency Condition Met

Start

job_print

SUCCESS job_print

Figure 3-2 File Watcher Job Stream

3-4

AutoSys Tutorial

Example Job Streams

Box Jobs
In this example job stream, a Box Job is used to group several jobs that have related starting conditions. The jobs inside the box are often called nested jobs, or child jobs of the parent Box Job. The job definitions and job stream are based on the following logic:
I

The bx_daily_update Box Job has date and time conditions specified for its starting conditions. This job is to be run every day of the week at 3:00 a.m. This box will serve as a container for three Command Jobs whose overall purpose is to update files and generate a report. The job_update Command Job is defined as being inside the bx_daily_update Box Job. It will run as soon as bx_daily_update starts, since it has no other starting conditions. The job_update job will update a set of files. The job_run_stats Command Job is defined as being inside the bx_daily_update Box Job. It has a job dependency condition specified for its starting parameter. It will run only on the completion of the job_update job. The job_run_stats job will run statistics against the updated files. The job_report_stats Command Job is defined as being inside the bx_daily_update Box Job. It has a job dependency condition specified for its starting parameter. It will run only on the completion of the job_run_stats job. The job_report_stats job will report on the statistics generated the by job_run_stats job.

This logic is illustrated in Figure 3-3.


Note: In this example, the done starting condition is used for the starting

condition of the job_run_stats and job_report_stats jobs. If these jobs used the success starting condition, and one of the jobs on which they were

dependent failed, the dependent job would not start, and thus would not complete. This would cause the bx_daily_update Box Job to run indefinitely since, by default, a Box Job cannot complete until all jobs in the Box Job have run and completed. You can however configure a Box Job with custom completion conditions. For information on how to do this, see Advanced Box Job Logic on page 3-7.

Job Streams 3-5

Example Job Streams

Job Definitions
bx_daily_update 3:00 a.m. Daily job_update job_run_stats done(job_update) Update Files Run Statistics job_report_stats done(job_run_stats) Report Statistics

Job Stream
Date/Time Conditions Met Start bx_daily_update

Start Box Running No other Conditions

job_update

job_update completes

Job Dependency Condition Met

Start

job_run_stats

job_run_stats completes

Job Dependency Condition Met

Start

job_report_stats

job_report_stats completes

Box Completes

DONE bx_daily_update

Figure 3-3 Box Job Stream

3-6

AutoSys Tutorial

Example Job Streams

Advanced Box Job Logic


In this example job stream, a Box Job similar to the previous example is used to organize several jobs. However, more sophisticated logic is applied to the job stream to address a situation in which jobs depend on the successful completion of other jobs, and these jobs can fail. The job definitions and job stream are based on the following logic:
I

The bx_daily_update Box Job has date and time conditions specified for its starting conditions. This job is to be run every day of the week at 3:00 a.m. This job will serve as a container for three Command Jobs whose overall purpose is to update files and generate a report. The job_update Command Job is defined as being inside the bx_daily_update Box Job. It will run when bx_daily_update has been started, since it has no other starting conditions. In addition, this job has a special attribute called box_terminator that specifies the following: the bx_daily_update box job (which contains this job_update job) should be terminated if the job_update job fails. The job_update job will update a set of files. The job_run_stats Command Job is defined as being inside the bx_daily_update Box Job. It will run only on the successful completion of the job_update job named. The job_run_stats job has a special attribute called box_terminator that specifies the following: the bx_daily_update box job (which contains this job_run_stats job) should be terminated if this job_run_stats job fails. The job_run_stats job will run statistics against the updated files. The job_report_stats Command Job is defined as being inside the bx_daily_update Box Job. It will run only on the successful completion of the job_run_stats job. The job_report_stats job will report on the statistics generated by job_run_stats. The job_trigger_msg Command Job has a job dependency condition specified for its starting parameter. It will run only on the FAILURE status of the bx_daily_update Box Job. The job_trigger_msg job will page an operator to indicate that the problem needs to be investigated.

This logic is illustrated in Figure 3-4 and in Figure 3-5.


Note: Figure 3-4 and Figure 3-5 illustrate the Advanced Box Job job definitions

and job stream example. However, in order to simplify the illustrations, the date/ time and job dependency conditions have been omitted in Figure 3-5.

Job Streams 3-7

Example Job Streams

Job Definitions
bx_daily_update 3:00 a.m. Daily job_update box_terminator Update Files job_run_stats success(job_update) box_terminator Run Statistics job_report_stats success(job_run_stats)

Report Statistics

job_trigger_msg failure(bx_daily_update) Page Operator

Figure 3-4 Advanced Box Job Definitions

3-8

AutoSys Tutorial

Example Job Streams

Job Stream
bx_daily_update job_update

SUCCESS job_update

FAILURE job_update

job_run_stats

SUCCESS job_run_stats

FAILURE job_run_stats

job_report_stats

SUCCESS job_report_stats

FAILURE job_report_stats

TERMINATED bx_daily_update SUCCESS bx_daily_update FAILURE bx_daily_update

job_trigger_msg

SUCCESS job_trigger_msg

Figure 3-5 Advanced Box Job Stream

Job Streams 3-9

Review

Review
I

A job stream (or flow) refers to the logic of how related AutoSys jobs are run. AutoSys jobs can be related in a number of ways. Much of the logic inherent in a job stream is based on the starting conditions of the jobs in the stream. There are basic and advanced job stream relationships, or dependencies. The following are examples of ways jobs can be related in a job stream: A Command job can be dependent on the successful completion of another job that has date and time starting conditions. A Command job can be dependent on a particular condition being satisfied for another job before it will run, such as the other job must have a SUCCESS or FAILURE completion status. A File Watcher Jobs successful completion is dependent on the creation and size of a particular file. In addition, other jobs can be dependent on the SUCESS of FAILURE of a File Watcher job. A Box Jobs successful completion is dependent on the successful completion of all the jobs inside the box (this is the default behavior for a Box Job). The jobs in a box that have no other starting conditions will run as soon as the box starts.

See Also
I

For information on job starting conditions, see the Starting Parameters section of Chapter 3, AutoSys Jobs, in the AutoSys User Manual for your platform. For more information on box jobs, job streams, and advanced job streams, refer to the AutoSys User Manual for your platform. For information on the box_terminator and other box-specific job attributes, refer to the attributes beginning with box_ in the AutoSys User Manual for your platform.

3-10

AutoSys Tutorial

Lesson

Defining and Running Jobs using the GUI

This lesson describes how to define and run jobs using the AutoSys Graphical User Interface (GUI). Topics to be Covered:
I I I I I

Topic Approach: Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On

AutoSys GUI Dialogs AutoSys Job Definition Dialog Defining a Command Job Running a Job Defining Jobs with Starting Conditions Defining a File Watcher Job Defining a Box Job

I I

Estimated Time:

75 Minutes

Note: If you have previously taken this lesson, you must delete the created jobs

and files. For instructions on how to do this, see Removing Jobs and Files on page 4-26.

Defining and Running Jobs using the GUI 4-1

AutoSys GUI Dialogs

AutoSys GUI Dialogs


The AutoSys GUI provides several dialogs that you can use to define Command, File Watcher, and Box Jobs. The complexity of the job definition determines how many dialogs you will use. In addition, there are dialogs that provide the means to send events and monitor jobs.

Starting the GUI


To start the GUI: UNIX: At the command prompt, enter the autosc & command. NT: In the AutoSys program group, double-click on the AutoSysGraphical Interface icon. The GUI Control Panel appears, as shown in Figure 4-1.

GUI Control Panel

Figure 4-1 GUI Control Panel


The Control Panel buttons perform the following actions:
I

Ops Console Displays the Job Activity Console, used for monitoring AutoSys jobs and alarms. From the Job Activity Console, you can open the Job Selection, Alarm Manager, and Alarm Selection dialogs. The Job Activity Console and its dialogs are referred to as the Operator Console (or Ops Console). Job Definition Displays the Job Definition dialog, used to create job definitions. From the Job Definition dialog, you can open the following dialogs: Advanced Features, Date/Time Options, and Calendar Definition. Calendars Displays the Calendar Definition screen, used for defining AutoSys run and exclude calendars. Monitor/Browser Displays the Monitor/Browser dialog, used to define and run monitors and reports (or browsers). HostScape, JobScape, and TimeScape belong to the AutoSys/Xpert product. These buttons will be greyed out if you have not purchased this product. Exit Exits the GUI

4-2

AutoSys Tutorial

AutoSys Job Definition Dialog

During this lesson, you can use the Operator Console, the Job Activity Console, and its related dialogs to see the progress of jobs in real time. This dialog displays information about AutoSys jobs and shows each job-related event as it occurs.
Note: To view the Operator Console, select the Ops Console button from the GUI

Control Panel. The Operator Console is discussed in detail in , Monitoring and Managing AutoSys.

AutoSys Job Definition Dialog


The Job Definition dialog provides all the fields you need to create a basic job definition. To access the Job Definition dialog: 1. At the GUI Control Panel, single-click on the Job Definition button. The Job Definition dialog appears, as shown in Figure 4-2.

Figure 4-2 Job Definition DMialog

Defining and Running Jobs using the GUI 4-3

AutoSys Job Definition Dialog

Job Definition Dialog Control Buttons


The control buttons at the top of the Job Definition dialog perform the following actions:
I

Clear Clears the dialog without saving any information to the Event Server (database). Use this button to clear all fields before defining a new job. Delete Deletes the currently displayed job from the Event Server. Save Stores the currently displayed job in the Event Server, either modifying a pre-existing job or creating a new one. When you Save a job definition, the dialog is also cleared in preparation for another job definition. Adv Features Displays the Job Definition Advanced Features dialog, which is used for all but the simplest of job definitions. Exit Closes the Job Definition dialog. If you click Exit without first clicking Save, your most recent job definition changes are not saved.

I I

The fields displayed in the Job Definition dialog are based on the type of job being defined. When you select a Job Type, only the fields appropriate to that type of job are displayed and activated, other fields are disabled.

Job Definition Dialog Regions


The Job Definition dialog is divided into the following three regions:
I

Basic Information The top region of the dialog has fields where you supply basic information, such as job name and job type. Starting Parameters The middle region of the dialog has the following components: A button for accessing the Date/Time Options dialog to specify date and time starting conditions. From the Date/Time Options dialog, you can also open the Calendar Definition screen. A field for entering job dependency conditions.

Command and File Watcher Information or Box Completion Conditions The bottom region of the dialog has fields in which you enter specific Command, File Watcher, or Box Job information.

4-4

AutoSys Tutorial

Defining a Command Job

Defining a Command Job


A Command Job executes a command on an agent machine. The Command Job you are about to define will execute a simple echo command. The name of the job will be your_name_lesson4.
Note: It is recommended that you use your last name for the your_name value

of the job namenow and throughout this lesson. Job names can be up to 30 characters long.

Using the Job Definition Dialog


In the Basic Information region: 1. 2. In the Job Name field, enter: your_name_lesson4 In the Job Type area, ensure that the Command radio button is selected.

In the Starting Parameters region: 3. Ensure that the Is the Start Date/Time Dependent option is set to No.

In the Command and File Watcher Information region: 4. 5. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the Command to Execute field, enter the following command: UNIX:/bin/echo "AutoSys Lesson 4 test" NT: echo AutoSys Lesson 4 test

Next, you will specify the name of the standard output file for the above message. You will use Job Definition Advanced Features dialog to do this.

Defining and Running Jobs using the GUI 4-5

Defining a Command Job

To access the Job Definition Advanced Features Dialog: 6. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears, as shown in Figure 4-3.

Figure 4-3 Job Definition Advanced Features Dialog


For the purposes of this lesson, we will only discuss the File to Redirect to Standard Output field, which you need to use for your Command Job. Specify a standard output file for the job in the Command Information region: 7. In the File to Redirect Standard Output field, enter the following: UNIX: /tmp/your_name4.out NT: C:\tmp\your_name4.out

4-6

AutoSys Tutorial

Defining a Command Job

Save the job to the AutoSys Database: 8. At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the database and closes the Job Definition Advanced Features dialog.

Exit the Job Definition Dialog 9. At the top of the dialog, click the Exit button. Keep the GUI Control Panel on your screen for the next part of this lesson.

Defining and Running Jobs using the GUI 4-7

Running a Job

Running a Job
As stated earlier, a job is started based on its starting conditions. The Command Job you just created does not have any starting conditions, so the only way this job will run is if you start it manually. You can start the job from the Send Event dialog, which is part of the Operator Console (discussed in Lesson 6, Monitoring and Managing AutoSys, of this tutorial). In the following sections, you will manually start the job and view the real-time events using the Send Event dialog and the Job Activity Console.

Send Event Dialog and Job Activity Console


To run the Job Manually and View the Events: 1. In the GUI Control Panel, click the Ops Console button. The Job Activity Console window of the Operator Console appears, as shown in Figure 4-4.

Figure 4-4 Job Activity Console

4-8

AutoSys Tutorial

Running a Job

2.

In the Control area at the bottom of the dialog, select the Event radio button in the Reports area, and deselect Freeze Frame radio button in the Show area. Now, when you manually start the job, you can view the event activity in the Event Report area. Choose Select Jobs from the View menu. This opens the Job Selection dialog. The default settings select All Jobs, All Statuses, and All Machines. Click OK in the Job Selection dialog to accept these defaults. When you return to the Job Activity Console, the your_name_lesson4 job should be displayed in the top field. Click on the your_name_lesson4 job to select it. In the Control area, click the Send Event button. The Send Event dialog appears, as shown in Figure 4-5.

3. 4.

5. 6.

Figure 4-5 Send Event Dialog


You can specify an event using one of the radio buttons at the top of the dialog. 7. Select the Start Job radio button. Just below these buttons is the Job Name field, which by default contains the name of the currently selected job.

Defining and Running Jobs using the GUI 4-9

Defining Jobs with Starting Conditions

8.

In the Job Name field, make sure that your_name_lesson4 is displayed. If it is not, enter the job name. Just below the Job Name is an area to specify when the event should occur. Select the Now button. You do not need to enter any information in the bottom region of the dialog at this time. The Send Priority is Normal by default. If you select High, the event is moved to the top of the unprocessed event queue.

9.

10. To send the event and dismiss the dialog, click the Execute button. At this time, you can view the events in the Event Report area of the Job Activity Console. When the job runs and completes successfully, the AutoSys Lesson 4 test message should be redirected to the your_name4.out file.
Note:

You can keep the Job Activity Console open to view the events for the rest of the exercises in this lesson. To view the standard output file: 11. At the command prompt, enter the following command: UNIX: cat /tmp/your_name4.out NT: type C:\tmp\your_name4.out You should see the following message:

AutoSys Lesson 4 test

Defining Jobs with Starting Conditions


If an AutoSys job definition contains starting conditions, it is run when those starting conditions are met. That is, a jobs starting conditions tell the Event Processor when to run a job. These conditions can be of the following two types:
I

Date and time conditions Specifies certain dates and/or times to run or not to run a job. Job dependency conditions Specifies that certain job events must occur before the job can be run.

In the next part of this lesson, you will set date and time conditions for the Command Job you just created, then you will specify a date/time dependency, or starting, condition for the job. To prepare for this module: Delete the standard output file created in the previous exercise. To do this, enter the following command at the command prompt:

4-10

AutoSys Tutorial

Defining Jobs with Starting Conditions

UNIX: rm /tmp/your_name4.out NT: del C:\tmp\your_name4.out

Specifying Date and Time Conditions


To add date and time conditions to the your_name_lesson4 job, you need to access the Date/Time Options dialog. To specify date and time conditions for a job: 1. 2. At the GUI Control Panel, click the Job Definition button. The Job Definition dialog appears. In the Job Name field, enter your_name_lesson4, and click Search. This action displays the entire job definition. Instead of typing the entire job name, you can enter the first three or four letters of your_name, and click Search. The entire job definition should display.

In the Starting Parameters region: 3. Ensure that there are date and time dependencies by selecting the Yes radio button.

To access the Date/Time Options dialog: 4. Click the Date/Time Options button. The Date/Time Options dialog appears, as shown in Figure 4-6.

Defining and Running Jobs using the GUI 4-11

Defining Jobs with Starting Conditions

Figure 4-6 Date/Time Options Dialog

Date/Time Options Dialog Regions


The Date/Time Options dialog has the following regions:
I

Date The left region of the dialog has fields where you specify the date conditions for a job. Time The right region of the dialog has fields where you specify the time conditions for a job. Control area The control area at the bottom of the dialog contains the Calendars and Dismiss buttons. The Calendars button accesses the AutoSys Calendar Definition dialog. The Dismiss button closes the Date/Time Options dialog. When you Dismiss this dialog, all entries are maintained in memory so that the subsequent Save process in the Job Definition dialog will also save the Date/Time Options settings.

In the Date region of the Date/Time Options dialog: 5. Select the radio button for today. For example, if today is Thursday, select the Thursday radio button.

4-12

AutoSys Tutorial

Defining Jobs with Starting Conditions

In the Time region: 6. In the Time(s) of Day field, enter a time that is only a few minutes away from the current time. You must enter the time in 24 hour format, using the HH:MM format shown in the dialog. For example, to specify 2:35 p.m., you enter 14:35.

To exit the Date/Time Options dialog: 7. At the bottom of the dialog, click the Dismiss button.

To save the date and time conditions you just specified: 8. At the top of the Job Definition dialog, click the Save button. This action the saves to the database the changed job definition for your_name_lesson4, with its new date and time conditions. Keep the Job Definition dialog open to define jobs later in this lesson.

Now that the your_name_lesson4 Command Job has starting parameters, you do not have to run it manually. As soon as the starting parameters have been satisfied, the Event Processor will start the job. Before continuing with the lesson, wait until the Time(s) of Day field value you specified has arrived, so that the job runs and completes. You can view the actions in the Job Activity Consoles Event Report area. Once the job runs, the specified message should be redirected to the standard output file. To view the standard output file: 9. At the command prompt, enter the following command: UNIX: cat /tmp/your_name4.out NT: type C:\tmp\your_name4.out You should see the following message:

AutoSys Lesson 4 test

Specifying Job Dependency Conditions


Now you will use the Job Definition dialog to specify a job dependency condition for your Command Job. The scenario is as follows:
I

First, you will define a new Command Job named your_name_depjob4 that will redirect a message to a file. You will specify that this job to be run only when your_name_lesson4 has completed successfully. Next, you will save your_name_depjob4 to the AutoSys database. Then you will change the date/time conditions for your_name_lesson4 and resave the job to the AutoSys database.

I I

Defining and Running Jobs using the GUI 4-13

Defining Jobs with Starting Conditions

When your_name_lesson4 completes successfully, the Event Processor checks if any jobs are dependent on the completion of this job. As a result, it will start your_name_depjob4.

To prepare for this module: You must delete the your_name4.out file. To do this, enter the following command at the command prompt: UNIX: rm /tmp/your_name4.out NT: del C:\tmp\your_name4.out To define a dependent job in the Basic Information region of the Job Definition dialog: 1. 2. In the Job Name field, enter the following: your_name_depjob4 In the Job Type area, ensure that the Command radio button is selected.

In the Starting Parameters region: 3. 4. Ensure that the Is the Start Date/Time Dependent option is set to No. In the Starting Condition field, enter the following: success(your_name_lesson4)

In the Command and File Watcher Information region: 5. 6. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the Command to Execute field, enter the following command: UNIX: date NT: ntgetdate

Next, you will specify the name of the standard output file for the results of this command. You do this at the Job Definition Advanced Features dialog. To specify standard output file for the job: 1. 2. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears. In the Command Information region, find the File to Redirect Standard Output field and enter: UNIX: /tmp/your_name_depjob4.out NT: C:\tmp\your_name_depjob4.out

To save your_name_depjob4 to the AutoSys database: At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the AutoSys database and closes the dialog.

4-14

AutoSys Tutorial

Defining Jobs with Starting Conditions

To change the date/time conditions for your_name_lesson4 in the Basic Information region of the Job Definition dialog: 1. 2. In the Job Name field, enter the following: your_name_lesson4 Click the Search button. This action retrieves the complete job definition from the AutoSys database and displays it in the dialog.

In the Starting Parameters region: 3. Ensure that the Is the Start Date/Time Dependent option is set to Yes.

To access the Date/Time Options dialog: 4. Click the Date/Time Options button, and the Date/Time Options dialog appears.

In the Time region of the Date/Time Options dialog: 5. In the Time(s) of Day field, enter a time that is only a few minutes away from the current time. You must enter the time in 24 hour format, using the HH:MM format shown in the dialog. For example, to specify 2:35 p.m., you enter 14:35.

To exit the Date/Time Options dialog: 6. At the bottom of the dialog, click the Dismiss button.

To save the date and time conditions you just specified: 7. At the top of the Job Definition dialog, click the Save button. This action re-saves to the database the job definition for your_name_lesson4, with its new date and time conditions. Before continuing with the lesson, wait until the Time(s) of Day field value you specified has arrived. You can view the event Activity in the Job Activity Consoles Event Report field. After your_name_lesson4 has completed successfully, the your_name_depjob4 job will start and redirect the current system date into the file your_name_depjob4.out. This process takes only a few seconds.

8.

To view the files created with this job stream: 9. At the command prompt, enter the following command: UNIX: cat /tmp/your_name4.out NT: type \tmp\your_name4.out You should see the following message:

AutoSys Lesson 4 test


10. At the command prompt, enter the following command: UNIX: cat /tmp/your_name_depjob4.out NT: type \tmp\your_name_depjob4.out

Defining and Running Jobs using the GUI 4-15

Defining a File Watcher Job

You should see the system date displayed.

Defining a File Watcher Job


The next job you will define is a File Watcher Job, as illustrated in Figure 4-7. A File Watcher Job starts a process on an agent machine that monitors the creation and size of a specific operating system file. When that file reaches a certain minimum size, and is no longer growing, the File Watcher Job sends an event to the AutoSys Event Server indicating that the job has succeeded and the file has arrived. The scenario is as follows:
I

First you will define the File Watcher Job named your_name_watcher and save it to the database. This job will have date/time conditions for its starting parameters. The job your_name_watcher will check every 15 seconds for a file you will be creating named your_name_file.txt. Only after this file is saved to the tmp directory and has stabilized will your_name_watcher complete successfully.

4-16

AutoSys Tutorial

Defining a File Watcher Job

Then you will define a Command Job named your_name_wdone and save it to the database. This job will have a job dependency condition specified for its starting condition. It will run only when the job your_name_watcher successfully completes. When run, this job will redirect a message to a file named your_name_wdone.out indicating that the job stream has completed successfully:
.

Job Definitions
your_name_watcher Specified Date/Time Watch for File your_name_wdone success( your_name_watcher) Create File

Job Stream
Date/Time Conditions Met Start

your_name_watcher

Creation and Stabilization of your_name_file.txt

SUCCESS your_name_watcher Job Dependency Condition Met

Start

your_name_wdone

Creation of your_name_wdone.out

SUCCESS your_name_wdone

Figure 4-7 File Watcher Job Stream


To define the File Watcher Job in the Basic Information region of the Job Definition dialog: 1. 2. In the Job Name field, enter the following: your_name_watcher In the Job Type area, ensure that the File Watcher radio button is selected.

In the Command and File Watcher Information region: 3. 4. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the File To Watch For field, enter: UNIX: /tmp/your_name_file.txt NT: C:\tmp\your_name_file.txt

Defining and Running Jobs using the GUI 4-17

Defining a File Watcher Job

In the Starting Parameters region: 5. Ensure that the Is the Start Date/Time Dependent option is set to Yes.

To access the Date/Time Options dialog: 6. Click the Date/Time Options button. The Date/Time Options dialog appears.

In the Date region of the Date/Time Options dialog: 7. Select the radio button for today.

In the Time region: 8. In the Time(s) of Day field, enter a time that is about 10 minutes later than the current time. You must enter the time in 24 hour format, using the HH:MM format shown in the dialog.

To exit the Date/Time Options dialog: 9. At the bottom of the dialog, click the Dismiss button.

Next, you will specify file watching criteria for the your_name_watcher job, as well as the name of the standard output file for the results of this command. You do this at the Job Definition Advanced Features dialog. To access the Job Definition Advanced Features dialog: 10. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears. To specify file watching criteria for the File Watcher Job: 11. At the File Watching Criteria region at the top of the Advanced Features dialog, in the Time Interval (secs) to Determine Steady State field, enter the following: 15 This value specifies that if the file named your_name_file.txt does not grow in size for a duration of 15 seconds, it will be considered stabilized. Note that the default value is 60. 12. At the File Watching Criteria region at the top of the dialog, in the Minimum File Size (in BYTES) field, ensure that the entry is this: 0 A specification of 0 bytes indicates that there is no minimum file size. Note that this is the default setting. To save the date/time and file watcher settings: 13. At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the database and closes the Job Definition Advanced Features dialog.

4-18

AutoSys Tutorial

Defining a File Watcher Job

Now you will create a Command Job named your_name_wdone. This job is a dependent job, and it will be started once your_name_watcher has completed successfully. To define the your_name_wdone job in the Basic Information region of the Job Definition dialog: 1. 2. In the Job Name field, enter the following: your_name_wdone In the Job Type area, ensure that the Command radio button is selected.

In the Starting Parameters region: 3. 4. Ensure that the Is the Start Date/Time Dependent option is set to No. In the Starting Condition field, enter the following: success (your_name_watcher) In the Command and File Watcher Information region: 5. 6. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the Command to Execute field, enter the following command: UNIX: /bin/echo "The job your_name_watcher has completed." NT: echo The job your_name_watcher has completed. After your_name_wdone has completed successfully, this message will be redirected to the your_name_wdone.out file.

Next, you will specify the name of the standard output file. You do this in the Job Definition Advanced Features dialog. To access the Job Definition Advanced Features dialog: 7. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears.

To specify standard output file for the job in the Command Information region of the Advance Features dialog: 8. In the File to Redirect Standard Output field, enter: UNIX: /tmp/your_name_wdone.out NT: C:\tmp\your_name_wdone.out

To save the job: 9. At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the database and closes the Job Definition Advanced Features dialog.

Defining and Running Jobs using the GUI 4-19

Defining a File Watcher Job

Initiating the Job Stream


Now you are ready to initiate the job stream and see how everything works. To initiate the job stream: 1. 2. 3. Start up a text editor, such as vi for UNIX or Notepad for NT, and create a file named your_name_file.txt. Enter any short string of text in the file. Save and exit the file.

Observing the Job Streams Progression


Assuming everything has been done properly, the following is occurring while the job stream progresses:
I

Once you saved and exited the file your_name_file.txt, it was only a matter of seconds before your_name_watcher started checking the files size and stability. Once the file your_name_file.txt has remained at the same size for 15 seconds, the Remote Agent that started your_name_watcher will send a SUCCESS event to the Event Server and exit. The successful completion of the your_name_watcher job will trigger the Event Processor to start the job named your_name_wdone. The your_name_watcher job creates the following message that will be redirected to the file your_name_wdone.out: The job your_name_watcher has completed.

You can view the stream of events in the Job Activity Console. To view the file created by this job stream: At the command prompt, enter the following command: UNIX: cat /tmp/your_name_wdone.out NT: type C:\tmp\your_name_wdone.out You should see the following message:

The job your_name_watcher has completed.

4-20

AutoSys Tutorial

Defining a Box Job

Defining a Box Job


The last job you will define is a Box Job. Figure 4-8 illustrates the job definitions and the job stream for this example Box Job exercise. A Box Job is an abstraction that defines a container of other jobs. A Box Job provides an organizational or grouping function of jobs with like or related starting conditions. The box itself performs no actions, although it can trigger other jobs to run. In this final exercise, you will do the following:
I I

Define a Box Job named your_name_box. Define two simple Command Jobs named your_name_job1 and your_name_job2, and specify that they be put in your_name_box. The your_name_job2 job will be dependent on the completion of the your_name_job1 job. Manually start the your_name_box job, and, as a result, both the your_name_job1 and your_name_job2 jobs will be run.

Defining and Running Jobs using the GUI 4-21

Defining a Box Job

Job Definitions
your_name_box
No starting conditions

your_name_job1
echo command

your_name_job2
done (your_name_job1) echo command

Job Stream
Start Box Job from the Send Event dialog Box Job running, no other start conditions Start

your_name_box

Start

your_name_job1

your_name_job1 completes

Job dependency condition met

Start

your_name_job2

your_name_job2 completes

Box Job completes

SUCCESS your_name_box

Figure 4-8 Box Job Definitions and Stream


To define the your_name_box Box Job in the Basic Information region of the Job Definition dialog: 1. 2. In the Job Name field, enter the following: your_name_box In the Job Type area, ensure that the Box radio button is selected. Notice that because of this action the Command and File Watcher region changes to Box Completion Conditions.

In the Starting Parameters region: 3. Ensure that the Is the Start Date/Time Dependent option is set to No.

To save the your_name_box job: 4. At the top of the Job Definition dialog, click the Save button. This action saves the new job definition to the database.

4-22

AutoSys Tutorial

Defining a Box Job

To define your_name_job1 in the Basic Information region of the Job Definition dialog: 1. 2. 3. In the Job Name field, enter the following: your_name_job1 In the Job Type area, ensure that the Command radio button is selected. In the Name of Box this Job is IN field, enter the following: your_name_box

In the Starting Parameters region: 4. Ensure that the Is the Start Date/Time Dependent option is set to No. Note that since this job has no starting conditions, it will be started when the your_name_box job is started.

In the Command and File Watcher Information region: 5. 6. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the Command to Execute field, enter the following command: UNIX: /bin/echo "your_name_job1 has successfully completed." NT: echo your_name_job1 has successfully completed. After your_name_job1 completes successfully, this message will be redirected to the your_name_job1.out file.

Next, you will specify the name of this standard output file. You do this at the Job Definition Advanced Features dialog. To access the Job Definition Advanced Features dialog: 7. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears.

To specify standard output file for the job in the Command Information region of the Advanced Features dialog: 8. In the File to Redirect Standard Output field, enter the following: UNIX: /tmp/your_name_job1.out NT: C:\tmp\your_name_job1.out

To save the job: 9. At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the database and closes the Job Definition Advanced Features dialog.

Defining and Running Jobs using the GUI 4-23

Defining a Box Job

To define your_name_job2 in the Basic Information region of the Job Definition dialog: 1. 2. 3. In the Job Name field, enter the following: your_name_job2 In the Job Type area, ensure that the Command radio button is selected. In the Name of Box this Job is IN field, enter the following: your_name_box

In the Starting Parameters region: 4. 5. Ensure that the Is the Start Date/Time Dependent option is set to No. In the Starting Conditions field, enter the following: done(your_name_job1) Notice that you are giving this job the done starting parameter. You do this to ensure that all jobs in the box will complete, and thus, the your_name_box Box Job will complete. If you were to use the success or failure starting conditions in this example, there is a possibility that the your_name_job2 job would never start, and thus never complete. This would cause the Box Job to continue running indefinitely. Note that you can set up Box Jobs and their contained jobs to use any starting conditions, using advanced logic. In the Command and File Watcher Information region: 6. 7. In the Execute on Machine field, enter the name of a valid AutoSys agent machine on which the command will run. In the Command to Execute field, enter the following command: UNIX: /bin/echo "your_name_job2 has successfully completed." NT: echo your_name_job2 has successfully completed. After your_name_job2 has completed successfully, this message will be redirected to the your_name_job2.out file. Next, you will specify the name of this standard output file. You do this at the Job Definition Advanced Features dialog. To access the Job Definition Advanced Features dialog: 8. At the top of the Job Definition dialog, click the Adv Features button. The Job Definition Advanced Features dialog appears.

To specify standard output file for the job in the Command Information region: 9. In the File to Redirect Standard Output field, enter the following: UNIX:/tmp/your_name_job2.out NT: C:\tmp\your_name_job2.out

4-24

AutoSys Tutorial

Defining a Box Job

To save the job: 10. At the top of the dialog, click the Save&Dismiss button. This action saves the new job to the database and closes the Job Definition Advanced Features dialog. To exit the Job Definition dialog: 11. At the top of the dialog, click the Exit button. To initiate the job stream and test your job definition for the new Box Job: 1. In the GUI Control Panel, click the Ops Console button. The Job Activity Console window of the Operator Console appears. If you have been viewing the AutoSys Event Report while you were running the jobs in this lesson, this window will be open already. If jobs are not already displayed in the Job Activity Console, choose Select Jobs from the View menu to open the Job Selection dialog. Accept the default settings and click OK to close the dialog. In the Job Activity Console Job List, select the job your_name_box. This makes this job the currently selected job In the Control area at the bottom of the console, click the Send Event button. The Send Event dialog appears. In the Send Event dialog, select the Start Job radio button. Just below these buttons is the Job Name field, which by default contains the name of the currently selected job. It should display the job your_name_box Just below the Job Name is an area to specify when the event should occur. Select the Now radio button. To send the event and dismiss the dialog, click the Execute button. The your_name_box job should run and the specified message should be redirected to the file named your_name_job2.out. In the Job Activity Console, you can view the events as they occur.

2.

3. 4. 5.

6. 7.

To view the files created with this job stream: 8. At the command prompt, enter the following command: UNIX: cat /tmp/your_name_job1.out NT: type C:\tmp\your_name_job1.out You should see the following message:

your_name_job1 has successfully completed.


9. At the command prompt, enter the following command: UNIX: cat /tmp/your_name_job2.out NT: type C:\tmp\your_name_job2.out You should see the following message:

your_name_job2 has successfully completed.

Defining and Running Jobs using the GUI 4-25

Removing Jobs and Files

To exit the AutoSys GUI and complete this lesson: Exit all open AutoSys dialogs and windows, and, in the GUI Control Panel, click the Exit button.

Removing Jobs and Files


If you are moving on to the next lesson, keep the job definitions and files you created. You will use them later in this tutorial. If you are repeating this lesson, you must first remove from the database the job definitions that you created previously. You must also delete the files created by these jobs when you ran them during this lesson.

Deleting Jobs
These are the job definitions that you must delete from the database:
I I I I I I I

your_name_lesson4 your_name_depjob4 your_name_watcher your_name_wdone your_name_box your_name_job1 your_name_job2

To delete these jobs: 1. Display the AutoSys GUI Control Panel: UNIX: At the command prompt, enter the autosc & command. NT: In the AutoSys program group, double click on the AutoSys Graphical Interface icon. The GUI Control Panel appears. At the GUI Control Panel, click the Job Definition button.The Job Definition dialog appears.

2.

In the Basic Information region: 3. 4. 5. In the Job Name field, enter the following: your_name_lesson4 Click the Search button. This action retrieves the job definition from the database and displays it in the dialog. Make absolutely sure this is the job definition for the job named

4-26

AutoSys Tutorial

Review

your_name_lesson4.
6. 7. At the top of the dialog, click the Delete button. This action deletes the job from the database. Repeat Steps 3 through 6 for all the jobs listed above.
4

Deleting Files
When the jobs in Lesson 4 are run, they create some files on your system in the following directory: UNIX: /tmp NT: C:\tmp
These are the files in that directory that you must delete:
I I I I I I

your_name4.out your_name_depjob4.out your_name_file.txt your_name_wdone.out your_name_job1.out your_name_job2.out

To delete these files:


Enter the following command: UNIX: rm /tmp/your_name* NT: del C:\tmp\your_name*

Review
I

AutoSys provides a complete GUI for defining Command, File Watcher, and Box jobs. The complexity of the job you are defining dictates how many AutoSys GUI dialogs you will need to use. The GUI dialogs also provide the means to send events (Send Event dialog) and monitor jobs (Operator Console dialogs). To access the GUI Control Panel: UNIX: Use the AutoSys autosc command. NT: Double-click on the AutoSys Graphical Interface icon in the AutoSys program group. The GUI Control Panel has eight buttons: Ops Console, Job Definition, Calendars, Monitor/Browser, HostScape, JobScape, TimeScape, and Exit.

Defining and Running Jobs using the GUI 4-27

See Also

To access the Job Definition dialog, you click the Job Definition button in the GUI Control Panel. This dialog provides all the fields you need to create a basic job definition. When using the GUI, you specify the type of job (Command, File Watcher, or Box) by selecting the appropriate radio button in the Job Definition Dialog. A jobs starting conditions tell the Event Processor when to start the job. Starting conditions can be of two types: date and time conditions and/or job dependency conditions. Jobs with starting conditions are started automatically by the Event Processor when the starting conditions have been satisfied. You specify date and time conditions at the Date/Time Options dialog, accessed from the Job Definition dialog. You specify job dependency conditions in the Starting Parameters region of the Job Definition dialog. When defining a File Watcher Job, you must enter the name of the file to watch for in the Job Definition dialog. You can access the Job Definition Advanced Features dialog and specify the time interval to determine a steady state and a minimum file size for the watched for job. When defining a job inside a Box Job, you use the Job Definition Dialog to specify the name of the Box the job is in. If a job does not have starting conditions, you must start it manually. You can use the Send Event dialog (accessed from the Job Activity Console) to start a job manually.

See Also
I

For more information on defining jobs using the AutoSys GUI dialogs, refer to the AutoSys User Manual for your platform. For information on using the Operator Console to monitor and manage jobs, see Lesson 6, in this tutorial, and then refer to the AutoSys User Manual for your platform. For information on how to set up calendars using the Calendar Definition window, refer to the AutoSys User Manual for your platform. For information on using the Monitor/Browser dialog, refer to the AutoSys User Manual for your platform. For information on advance Box Job logic, refer to the AutoSys User Manual for your platform. For information on how to assign the machine job attribute, as well as other job attributes, to implement job load balancing and queuing, refer to Lesson 7 in this tutorial, then refer to the AutoSys User Manual for your platform.

4-28

AutoSys Tutorial

Lesson

Defining and Running Jobs using JIL

This lesson describes how to define and run jobs using the AutoSys Job Information Language (JIL). Topics to be Covered:
I I I I I

Topic Approach: Conceptual Conceptual Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On

Job Information Language JIL Syntax Defining a Command Job Running a Job Defining Jobs with Starting Conditions

Estimated Time:

30 Minutes

Note: If you have previously taken this lesson, you must delete the created jobs

and files. For instructions on how to do this, see Removing Jobs and Files on page 5-14.

Defining and Running Jobs using JIL 5-1

Before You Begin

Before You Begin


During this lesson, you can see a real-time report of the status of jobs once they are started using the autolog command. This command displays the Event Processor log file and shows each job-related event as it occurs. This log can be very helpful because it shows you what is happening as you proceed with each part of the lesson. You should run this process in its own window, separate from the window in which you are running JIL. On UNIX, you should run the command in its own shell, and on NT, you should run the command in its own AutoSys Instance Command Prompt window. At the command prompt, enter the following: autolog -e This displays the Event Processor log file and shows each job-related event as it occurs. You can terminate this reporting at any time by pressing <Control+C>.
Note:

On NT, you must use an AutoSys Instance Command Prompt window to execute all AutoSys commands and processes. You can open an AutoSys Instance Command prompt by double-clicking on the icon in the AutoSys program group. This command prompt window sets several necessary AutoSys environment variables.

Job Information Language


As an alternative to the GUI, you can also use the AutoSys proprietary scripting languageJob Information Language (or JIL) to create job definitions. This job definition must be submitted to the AutoSys database before the job can be run. To define a job using JIL, you can do one of the following:
I

Submit the full job definition by redirecting a JIL script file to the jil command. (This is the process you will use in this lesson.) Interactively submit the job definition by issuing the jil command first, and then entering JIL statements at the jil>> command prompt.

Both of these methods are analogous to saving a job definition in the AutoSys GUI at the Job Definition dialog. When you enter a job definition using JIL, it contains the following information:
I

One or more JIL job definition sub-commands, which you can use to create, modify, and delete job definitions. One or more attribute statements, which define when, where, and how a job should be run.

5-2

AutoSys Tutorial

Job Information Language

JIL Sub-Commands
There are the five JIL sub-commands that you can use to create, modify, and delete job definitions. These sub-commands are described in the following table:
Table 1:

Sub-command
insert_job update_job delete_job delete_box

Action

Adds a new job to AutoSys. Edits fields on an existing job. Deletes this job from AutoSys. Deletes the specified Box Job, and recursively deletes all the jobs that are contained in the box. Applies overrides on indicated job attributes for only the next run of this job.

override_job

Basic JIL Attribute Types


Even though AutoSys has a number of job, monitor/report, and machine attributes, there are basic attribute types you almost always use when defining when, where, and how a job should be run. These attribute types are described in the following table:
Table 2: Attribute Type Job Name Job Type Job Characteristic

All (Required) All (Required)

Identifies the job. This is an argument to one of the JIL sub-commands, like this: insert_job: install_test Identifies the type of job: either c for Command, f for File Watcher, or b for Box. For example, you would specify a box like this: job_type: b Identifies the agent machine on which the job should run, like this: machine: machine_name Specifies the date and time, or the job dependency conditions for a job, like this: days_of_week: mo, we, fr condition: success(my_job)

Job Type

Machine Name

Command, File Watcher (Required) All (Optional)

Starting Conditions

Defining and Running Jobs using JIL 5-3

JIL Syntax

Table 2: Attribute Type File to Watch For Job Type Job Characteristic

File Watcher (Required)

Specifies a file for which to watch. For example, on UNIX you might specify this: watch_file: /tmp/mainframe_file

JIL Syntax
When writing a JIL script, you must follow the syntax rules listed below.
Rule 1

Each sub-command uses the following form:


sub_command: job_name

where
I I

sub_command is one of the sub-commands listed in the above table. job_name is the user-specified name of the job to be acted on.

Rule 2

Each sub-command can be followed by one or more attribute statements. These statements can occur in any order, and are applied to the job specified in the preceding sub-command. A subsequent sub-command begins a new set of attributes for a different job. The attribute statements have the following form:
attribute_keyword: value

where
I I

attribute_keyword is one of the legal JIL attributes. value is the setting to be applied to the attribute.

Rule 3

Multiple attribute statements can be entered on the same line. However, they must be separated by at least one space.
Rule 4

A box that contains jobs must be defined before the jobs can be placed in it.
Rule 5

5-4

AutoSys Tutorial

Defining a Command Job

Legal value settings can include any of the following characters: upper- and lower-case letters, hyphens, underscores, numbers, colons (if the colon is escaped with quotes or a preceding backslash; see Rule 6), and the special character @.
Rule 6

Any colons used in an attribute statements value setting must be escaped because JIL parses on the combination of keyword followed by a colon. For example, to specify the time to start a job, specify 10:00, or escape the colon with a preceding backslash \, as in 10\:00.
Rule 7

Comments are indicated using one of the following two methods:


I

You can comment out an entire line by placing a pound sign # in the first column. You can use the C programming syntax by beginning a comment with /* and ending it with */. This approach allows comments to span multiple lines. The following is an example comment:
/* this is a comment */

Defining a Command Job


The first job you will define is a Command Job. It will be identical to the first Command Job you defined in Lesson 4. However, the name of this job is your_name_lesson5. As in the last lesson, this Command Job will execute a simple echo command on a valid AutoSys agent machine.
Note: It is recommended that you use your last name for the your_name value

of the job namenow and throughout this lesson. Job names can be up to 30 characters long. To define a Command Job using JIL: 1. Start your favorite text editor, and create the following file in the tmp directory: your_name_lesson5.jil

Defining and Running Jobs using JIL 5-5

Defining a Command Job

2.

Using the editor, enter the following JIL script: UNIX:


# JIL script to test the AutoSys installation. # This script will re-direct a message to the # file named /tmp/your_name5.out.

insert_job: your_name_lesson5 machine: machine_name command: /bin/echo "AutoSys Lesson 5 test" std_out_file: /tmp/your_name5.out
NT:
# JIL script to test the AutoSys installation. # This script will re-direct a message to the # file named C:\tmp\your_name5.out.

insert_job: your_name_lesson5 machine: machine_name command: echo AutoSys Lesson 5 test std_out_file: "C:\tmp\your_name5.out"

The Event Processor on the system interprets the above JIL scripts in the following way:
Line 1-3 4 5 Summary Comments about the script. Blank Not read. JIL Sub-Command The name of the job is your_name_lesson5. Machine Attribute The agent machine on which the job should run. The machine_name value must be a valid AutoSys agent machine at your site. Command Attribute The command the job should run on the agent machine is: echo the AutoSys Lesson 5 test message. File Redirection Attribute The file to which standard output should be redirected is the following: UNIX: /tmp/your_name5.out NT: C:\tmp\your_name5.out

3.

Save (write) and exit the file.

5-6

AutoSys Tutorial

Running a Job

To save the job to the AutoSys Event Server: 4. At the command prompt, enter the following command:
jil < your_name_lesson5.jil This re-direction of the text file containing your JIL script saves the your_name_lesson5 job to the Event Server (database). The following message should display to standard output, indicating that the job has been successfully submitted to the database:

_______________________________________ Insert/Updating Job: your_name_lesson5 Database Change WAS Successful! _______________________________________ Exit Code = 0 _______________________________________

Running a Job
A job is started based on its starting conditions. However, the Command Job you just created does not have any starting conditions. Therefore, to run this job, you must start it manually. To run the job manually: At the command prompt, enter the following:
sendevent -E STARTJOB -J your_name_lesson5

The STARTJOB option should be in all upper-case letters. These are the options to the sendevent command:
I I

-E STARTJOB Indicates the event you want to send. -J your_name_lesson5 Indicates the job you want to run.

Defining and Running Jobs using JIL 5-7

Defining Jobs with Starting Conditions

When the job runs, the specified message should be re-directed to the file named your_name5.out. To view the your_name5.out file: At the command prompt, enter the following command: UNIX:cat /tmp/your_name5.out NT: type C:\tmp\your_name5.out You should see the following message:

AutoSys Lesson 5 test

Defining Jobs with Starting Conditions


Jobs can be defined that are dependent on certain starting conditions. A jobs starting conditions tell the Event Processor when to run the job. These conditions can be of the following two types:
I

Date and time conditions Specifies certain dates and/or times to run or not to run a job. Job dependency conditions Specifies that certain job events occur before the job can be run.

In this next part of the lesson, you will first set date and time conditions for the Command Job you just created, then you will specify a job dependency condition for the job. To prepare for this module, delete the standard output file created in the previous exercise. At the command prompt, enter the following: UNIX: rm /tmp/your_name5.out NT: del C:\tmp\your_name5.out

5-8

AutoSys Tutorial

Defining Jobs with Starting Conditions

Specifying Date and Time Conditions


To add date and time conditions to the your_name_lesson5 job, edit the JIL script defining this job. To specify date and time conditions for a job: 1. Open the following file in your favorite text editor:
your_name_lesson5.jil Using an editor, modify the JIL script as shown in the example scripts below (revised/added lines are shown in bold). When adding these lines, you should indicate todays day of the week for the days_of_week attribute, using the mo, tu, we, th, fr, sa, or su values. In addition, you should indicate for the start_times attribute a time value that is only a few minutes away from the current time, using a 24-hour format enclosed in quotes. For example, 2:00 p.m. is written as "14:00". UNIX:

# JIL script to test the AutoSys installation. # This script will re-direct a message to the # file named /tmp/your_name5.out.
update_job: your_name_lesson5

machine: machine_name command: /bin/echo "AutoSys Lesson 5 test" std_out_file: /tmp/your_name5.out


date_conditions: y days_of_week: fr start_times: "9:05"

NT:

# JIL script to test the AutoSys installation. # This script will re-direct a message to the # file named C:\tmp\your_name5.out.
update_job: your_name_lesson5

machine: machine_name command: echo AutoSys Lesson 5 test std_out_file: "C:\tmp\your_name5.out"


date_conditions: y days_of_week: fr start_times: "9:05"

Defining and Running Jobs using JIL 5-9

Defining Jobs with Starting Conditions

The Event Processor interprets the new lines in the script in the following way: Line Summary 5 JIL Sub-Command Update the existing job in the database. The your_name_lesson5 job is already exists in the database, but you are modifying it. Therefore, the Event Processor must know to update the job definition in the database. 9 Date Conditions Attribute Indicates that there are date and/or time conditions specified for this job (i.e., y means that there are date/time conditions). 10 Days Attribute Run the job on this day of the week (i.e., fr means run the job on Friday). For this attribute, you can use these values: mo, tu, we, th, fr, sa, or su. 11 Start Time Attribute Run the job at this time of day (i.e., "9:05" means run the job at five minutes after nine oclock in the morning). Note that the start_times value uses a 24-hour format, and it is enclosed in quotes. The quotes prevent the Event Processor from interpreting the colon incorrectly. 2. Save (write) and exit the file.

To save to the database these new date and time conditions: 3. At the command prompt, enter the following command: jil < your_name_lesson5.jil The following message should display to standard output, indicating that the job has been successfully re-submitted to the AutoSys Event Server:

______________________________________ Insert/Updating Job: your_name_lesson5 Database Change WAS Successful! _______________________________________ Exit Code = 0 _______________________________________
Now the Command Job named your_name_lesson5 does have starting parameters. And as a result, you do not have to run it manually. As soon as the starting parameters have been satisfied, the Event Processor will run the job. Before continuing with the lesson, wait until the start_times value you specified has arrived. If you are running an autolog -e process in a command prompt window, you can view the Event Processor event activity in that window, and you will know when the job runs and completes. Once the job runs, the specified message should be re-directed to the your_name5.out file.

5-10

AutoSys Tutorial

Defining Jobs with Starting Conditions

To view the your_name5.out file: At the command prompt, enter the following command: UNIX:cat /tmp/your_name5.out NT: type C:\tmp\your_name5.out You should see the following message:

AutoSys Lesson 5 test

Specifying Job Dependency Conditions


Now you will specify a job dependency condition for your Command Job. The scenario is as follows:
I

You will define a new Command Job your_name_depjob5 and specify that it run only when your_name_lesson5 has completed successfully. You will save your_name_depjob5 to the AutoSys Event Server. You will change the date/time conditions for your_name_lesson5 and re-save the job to the Event Server (database).

I I

When your_name_lesson5 runs and completes successfully, the Event Processor will determine that the your_name_depjob5 job should be run, and, as a result, run the job. Then, the your_name_depjob5 job will re-direct a message to the your_name_depjob5.out standard output file. To prepare for this module: Delete the standard output file created in the previous exercise. To do this, enter the following at the command prompt: UNIX: rm /tmp/your_name5.out NT: del C:\tmp\your_name5.out To define a dependent job: 1. Start up your favorite editor, and create the following file in the tmp directory:

your_name_depjob5.jil
2. Using the editor, enter the following JIL script:

Defining and Running Jobs using JIL 5-11

Defining Jobs with Starting Conditions

UNIX:

# JIL script to demonstrate a job dependency. # This job will run only when the job named # your_name_lesson5 has completed successfully. insert_job: your_name_depjob5 machine: machine_name condition: success(your_name_lesson5) command: date std_out_file: /tmp/your_name_depjob5.out
NT:

# JIL script to demonstrate a job dependency. # This job will run only when the job named # your_name_lesson5 has completed successfully. insert_job: your_name_depjob5 machine: machine_name condition: success(your_name_lesson5) command: ntgetdate std_out_file: "C:\tmp\your_name_depjob5.out"
The Event Processor interprets the lines in the script in the following way: Line Meaning 1-3 Comments about the script. 4 Blank Not read. 5 JIL Sub-Command The name of the new job to insert into the database is your_name_depjob5. 6 Machine Attribute The agent machine on which the job should run. The machine_name value must be a valid AutoSys agent machine at your site. 7 Condition Attribute This job should not run until the your_name_lesson5 job has run successfully. 8 Command Attribute The command the job should run on the agent machine. In this case, this attribute value is the date or ntgetdate command. 9 File Redirection Attribute The file to which standard output should be redirected. 3. Save (write) and exit the file.

5-12

AutoSys Tutorial

Defining Jobs with Starting Conditions

To save your_name_depjob5 to the AutoSys database: 4. At the command prompt, enter the following:
jil < your_name_depjob5.jil The Insert/Updating Job:... message should display to standard output.

To change the date/time conditions for your_name_lesson5: 1. 2. 3. Start your favorite editor and open the following file:
your_name_lesson5.jil

Using the editor, modify the JIL script to indicate a time that is a few minutes away from the current time for the start_times attribute. Save (write) and exit the file.

To save the date and time conditions you just specified: 4. At the command prompt, enter the following: jil < your_name_lesson5.jil This re-submits the job definition for your_name_lesson5, with its new date and time conditions, to the Event Server (database). The Insert/Updating Job:... message should display.

Before continuing with the lesson, wait until the start_times value you specified has passed. You can view the Event Processor activity in the command prompt window that is running the autolog -e command. After the your_name_lesson5 job has completed successfully, the your_name_depjob5 job will start and re-direct the current system date into the your_name_depjob5.out file. As a result, you will be able to view the files created by this job stream. To view the files created with this job stream: 1. At the command prompt, enter the following command: UNIX: cat /tmp/your_name5.out NT: type C:\tmp\your_name5.out You should see the following message:

AutoSys Lesson 5 test


2. At the command prompt, enter the following: UNIX: cat /tmp/your_namedepjob5.out NT: type C:\tmp\your_namedepjob5.out You should see the system date displayed.

Defining and Running Jobs using JIL 5-13

Removing Jobs and Files

Removing Jobs and Files


If you are moving on to the next lesson, keep the job definitions and files you created. You will use them later in this tutorial. If you are repeating this lesson, you must first remove from the AutoSys database the job definitions that you created the first time. You must also delete the files created by these jobs when you ran them during the lesson.

Deleting Jobs
These are the job definitions that you must delete from the database:
I I

your_name_lesson5 your_name_depjob5

To delete these jobs: 1. 2. 3. 4. At the command prompt, enter the following command: jil At the jil prompt, enter the following command:
delete_job: your_name_depjob5

Enter the following command:


delete_job: your_name_lesson5

Enter the following command:


exit This exits the jil command mode. The standard output message will tell you whether the job definitions were successfully deleted.

Deleting Files
When the jobs in Lesson 5 are run, they create some files on your system in the following directory:

UNIX:/tmp NT:C:\tmp
These are the files in this directory that you must delete:
I I I I

your_name5.out your_name_lesson5.jil your_name_depjob5.out your_name_depjob.jil

5-14

AutoSys Tutorial

Review

To delete these files: Enter the following command: UNIX: rm /tmp/your_name* NT: del C:\tmp\your_name*

Review
I

The AutoSys Job Information Language (JIL) is a proprietary scripting language that can be used to create job definitions. You can use JIL sub-commands to create, modify, and delete job definitions. These are the five JIL sub-commands used to create, modify, and delete job definitions: insert_job, update_job, delete_job, delete_box, and override_job. You can use JIL attribute statements to define when, where, and how a job should run. Even though JIL has a number of JIL job attribute statements, you will use the following basic attribute types most often: Job Name, Job Type, Machine Name, Starting Conditions, and File to Watch For. You can create or modify a job definition by redirecting a JIL script file using the jil command, or by using JIL sub-commands and attribute statements at the jil>> prompt. When writing a JIL script and entering sub-commands and attribute statements, there are seven syntax rules you must follow. When using AutoSys commands on NT, you must use the AutoSys Instance Command Prompt window.

I I

Defining and Running Jobs using JIL 5-15

See Also

See Also
I

For a list of AutoSys job attributes, refer to Chapter 4, Job Attributes, in the AutoSys User Manual for your platform. For more information on using JIL to define jobs, refer to the AutoSys User Manual for your platform. For a complete listing of JIL sub-commands and job definition attributes, refer to the AutoSys User Manual for your platform. For information on how to use AutoSys commands, refer to the AutoSys User Manual for your platform. For a complete listing of AutoSys commands, refer to the AutoSys User Manual for your platform. For information on how to assign the machine job attribute, as well as other job attributes, to implement job load balancing and queuing, see 7 in this tutorial, then refer to the AutoSys User Manual for your platform.

5-16

AutoSys Tutorial

Lesson

Monitoring and Managing AutoSys

This lesson describes how to access the AutoSys features used for monitoring and managing AutoSys jobs and alarms. Topics to be Covered:
I I I I I I

Topic Approach: Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On Conceptual/Hands-On

Operator Console Job Activity Console Job Selection Dialog AutoSys Alarms Alarm Manager Dialog Alarm Selection Dialog

Estimated Time:

60 Minutes

Operator Console
The Operator Console refers to a collection of dialogs used for monitoring and managing AutoSys jobs in real-time. When you first access the Operator Console, the Job Activity Console is displayed. From this console you can view all the jobs defined to AutoSys, along with a brief description and the current status. In addition, you can access dialogs to view the job definition and job dependencies. Also available from the Job Activity console are the Job Selection, Alarm Manager, and Alarm Selection dialogs. You can use the Job Selection dialog to determine, at any time, which jobs you want to view, based on various parameters such as current job states, job names, and the specific machines on which jobs are defined to run.

Monitoring and Managing AutoSys 6-1

Operator Console

You can select any job and view more detailed information about it, including its starting conditions, its dependent jobs, and various types of reports that describe the progression of the job run. You can even display the job definition and, if you have the required permissions, make changes to the job. The Operator Console consists of the following elements:
I

Job Activity Console The primary interface to the Operator Console, and it is used for monitoring jobs. Job Selection dialog Used to specify which jobs you want to view. Alarm Manager dialog Allows you to browse any alarms that have occurred, and to acknowledge (and log a response to) those alarms. Alarm Selection dialog Provides a way for you to specify which alarms you want to view at any given time.
6

I I

Starting the Operator Console


To start the Operator Console: At the GUI Control Panel, single-click on the Ops Console button. You can also start the Operator Console by typing the following at the command prompt: autocons & The Job Activity Console appears, as shown in Figure 6-1.
Note:

The Job Activity Console is blank when it initially displays. In order for jobs to be displayed, as they are in Figure 6-1, you must first use the Job Selection dialog, as explained on page 6-11.

6-2

AutoSys Tutorial

Job Activity Console

Figure 6-1 Job Activity Console


By default, the information displayed in the Job Activity Console is updated every 5 seconds with information retrieved from the database. To prevent the screen from being updated constantly, the console starts up in Freeze Frame mode. For an explanation of how to toggle Freeze Frame mode, see Freeze Frame on page 6-10.

Job Activity Console


The Job Activity Console contains a menu bar and the following three regions:
I

Job List Displays a list of all jobs stored in the database, or displays the jobs you specified in the Job Selection dialog. Currently Selected Job Displays more detailed information about the currently selected job.

Monitoring and Managing AutoSys 6-3

Job Activity Console

Control Area The left side of this area contains buttons that act on the currently selected job; the middle of this area contains buttons that provide control functions for the Console screen; the right side contains the Alarm button, which displays the Alarm Dialog, and the Exit button to exit the Job Activity Console.
6

Menu Bar
At the top of the Job Activity Console is the menu bar, containing three menus: File, View, and Options. File menuContains the Exit option, which functions exactly like the Exit button in the Control area. Before exiting, a verification dialog displays asking you to confirm. If you confirm, the Job Activity Console is closed. If the Alarm Manager is open, it is closed as well. View menuContains the Select Jobs option, which displays the Job Selection dialog. Options menuContains the Console Clock Perspective option, which controls the time perspective of the display. This option gives you three choices: Server Time, Current Job Time, or Local Machine Time.

Job List
The Job List region displays a list of all the jobs defined to AutoSys, and this display is subject to the job selection criteria currently in effect. Each entry in the Job List contains the following information about a single job:
I I I I

Job name. Description. Current status. Command defined for this job, if it is a Command Job; the file to watch for, if it is a File Watcher Job; and nothing, if it is a Box Job. Machine on which the job is defined to run.

The entries in the Job List provide a snapshot of the entire instance, across multiple machines. To inspect the jobs you defined in Lessons 4 and 5: 1. 2. In the View menu, select the Select Jobs option. This displays the Job Selection dialog. In the Job Selection dialog, locate the Job Name field and enter your_name*. Ensure the All Statuses and All Machines options are selected (these are the default settings). Then, to begin the search and dismiss the dialog, click OK.

6-4

AutoSys Tutorial

Job Activity Console

3.

A list of jobs beginning with your_name should appear in the Job List in the Job Activity Console. Look for the following jobs (you can use the scroll bar to view the entire list if needed): your_name_lesson4, defined in Lesson 4 your_name_depjob4, defined in Lesson 4 your_name_watcher, defined in Lesson 4 your_name_wdone, defined in Lesson 4 your_name_box, defined in Lesson 4 your_name_job1, defined in Lesson 4 your_name_job2, defined in Lesson 4 your_name_lesson5, defined in Lesson 5 your_name_depjob5, defined in Lesson 5

You can select any job in the Job List by single-clicking on the line on which the jobs information displays. The job you click on becomes the currently selected job, and detailed information about the job appears in the Currently Selected Job region. To inspect more detailed information about a job you have defined: In the Job List, single-click on a job, and the job description appears in the Currently Selected Job region.

Currently Selected Job


The Currently Selected Job region of the window displays more detailed information about the most recent execution of the currently selected job, such as its start time and exit code. This information is updated with each execution of the job. This area also displays the jobs entire starting condition, as specified in the job definition, as well as the atomic conditionswhich are the basic components of an overall condition. To view more detailed information for a job you have defined:

Monitoring and Managing AutoSys 6-5

Job Activity Console

1. 2.

In the Job List, single-click on the your_name_lesson4 job. This job thus becomes the currently selected job. In the Currently Selected Job region, check the following fields: Table 3: Field Display UNIX: /bin/echo AutoSys Lesson 4 test NT: echo AutoSys Lesson 4 test The date and time the job started. The date and time the job ended. The amount of time it took for the job to run. Success 0 The machine on which the job ran.

Command Start Time End Time Run Time Status Exit Code Machine

To view the starting conditions for a job you have defined: 1. 2. In the Job List, single-click on the your_name_depjob4 job. This job becomes the currently selected job. In the Currently Selected Job region, verify that the Starting Conditions field shows the following: success(your_name_lesson4)

Control Area

The Control area at the bottom of the Job Activity Console contains the following:
I I I

Action buttons, which act on the currently selected job. Control buttons, which provide control functions for the console. The Alarm button, which indicates an alarm has occurred and accesses the Alarm Manager dialog. The Exit button, which dismisses the Job Activity Console.
6

Action Buttons
The left side of the Control area is the Actions area containing a group of buttons that can be clicked to initiate certain actions on the currently selected job or jobs. By clicking the appropriate button, you can issue an event that will do one of the following:
I

Start a job

6-6

AutoSys Tutorial

Job Activity Console

I I I I

Kill a job Force a job to start Place a job on hold Take a job off hold

In each of these cases, a dialog asks you to confirm the action. If you confirm, the event is processed immediately. In addition, there is the Send Event button, which if clicked displays the Send Event dialog that allows you to send any type of event. The last column of buttons are user-configurable. You can associate any command with these buttons, and specify your own button labels. You can use any of these action buttons to issue events on multiple AutoSys jobs. To do this, you select multiple jobs from the job list area, and then click the appropriate button, or open the Send Even dialog to issue the event. To select multiple jobs from the Job List area of the Job Activity Console: To select a contiguous group of jobs: Single-click on the first job then press <Shift>, and single-click on the last job to be selected. To select a noncontiguous group of jobs: Single-click on the first job, then press <Control>, and single-click on additional jobs in any order. To deselect a job: Press <Control> and single-click on the job.

Send Event Dialog


The Send Event dialog allows you to do the following:
I I

Send any event that can be sent manually in AutoSys. Select the various event parameters you want to specify when sending the event. Cancel an event that has been scheduled to occur in the future.

To display the Send Event dialog: 1. In the Control area, click the Send Event button. The Send Event dialog appears, as shown in Figure 6-2.

Monitoring and Managing AutoSys 6-7

Job Activity Console

Figure 6-2 Send Event Dialog


Choose an event type using the radio buttons at the top of the dialog. Just below these buttons is the Job Name field, which displays the name of the currently selected job. If desired, you can enter a different job name in this field. You can specify when the event is to take effect: either immediately (the default) or at some future date and time. Note that the current time and date are provided as defaults for your convenience. Use the A.M. and P.M. radio buttons if you want to specify the time using a 12-hour format. By default, a time with less than 13 in the hours is considered a.m., while any larger value is considered p.m. The Comment field lets you enter text to be associated with this event in the database. This field is for documentation purposes only. For example, if you force a job to start, you can provide an explanation about why this was necessary. The Execute button of the dialog executes, or sends, the event. The Cancel button cancels the event that was about to be sent. When either button is clicked, the Send Event dialog is dismissed.
Note:

The other fields in this dialog are not used for this exercise. For more information on the fields, refer to the AutoSys User Manual for your platform. To send an event for a job you have defined: 1. In the Event Type region, select the Force Start Job radio button. Use this event to force start a job, overriding the starting parameters defined for it. In the Job Name field, enter the following: your_name_lesson4 Be sure the Now radio button is selected (this is the default setting).

2. 3.

6-8

AutoSys Tutorial

Job Activity Console

4.

At the bottom of the dialog, click the Execute button, then click OK in the confirmation dialog. This action starts the your_name_lesson4 job.

The event buttons at the bottom of the Job Activity Console can also be used to send events without accessing the Send Event dialog. However, all of the event types are not available in this group of Action buttons, but they are available in the Send Event dialog. To view information about the job you just started: 1. 2. 3. In the Job List, single-click on the your_name_lesson4 job. This job becomes the currently selected job. In the Currently Selected Job region, note when the job started, ended, and its completion status. This status should be SUCCESS. In the Control area, locate the Reports region and select the Summary button to view the Summary report. Then select the Event button to view the more detailed Event report. (The Reports control area is described in Reports on page 6-10.)
6

Control Buttons
In the middle of the Control area, there are several push buttons that provide control functions for the Console screen.

Job Definition
The Job Definition button displays the Job Definition dialog, with the currently selected job already displayed. This allows you to quickly review the jobs definition, and change it if necessary (and if permissions allow).

Dependent Jobs
The Dependent Jobs button displays the Dependent Jobs dialog which contains a list of all the jobs that are directly dependent on the currently selected job. This allows you to quickly see which jobs are dependent upon the current job. In particular, it shows which jobs will not run until the current job completes. This is useful if the currently selected job is running late and you need to determine the impact of the situation. To display the Dependent Jobs dialog: 1. In the Control area, locate the Show area, and click the Dependent Jobs button. The Dependent Jobs dialog appears, as shown in Figure 6-3. Because your_name_lesson4 is the currently selected job, this dialog displays the one job dependent on it, your_name_depjob4.

Monitoring and Managing AutoSys 6-9

Job Activity Console

Figure 6-3 Dependent Jobs Dialog


2. To dismiss the dialog, click Close.

Freeze Frame
Initially, the Job Activity Console displays in Freeze Frame mode. This mode freezes the console display, which otherwise is regularly updated. By default, the display is updated every 5 seconds (directions to change this setting are in the AutoSys User Manual for your platform). In Freeze Frame mode, all processing continues normally, but the screen is not refreshed. When Freeze Frame mode is off, the console displays job progressions in real-time. To activate and deactivate Freeze Frame mode, select or deselect the Freeze Frame radio button.

Reports
You can choose a type of report from the Reports area options, and the report will appear on the right side of the Currently Selected Job region in the Reports area. This area displays a real-time report that presents job run information in the same format as that produced by the autorep command. You can choose one of the following report types:
I

Summary Displays a one-line synopsis of the last or current execution of the job. This shows the job name, timestamp of the last start and last end of the job, status, job run number and number of tries (separated by a slash), and priority (if the job is in QUE_WAIT status) or exit code (if the job completed). Event Displays a detailed report listing all the events and statuses from the last or current execution of the job. Figure 6-1 on page 6-3 shows an Event Report. None Displays no report.

Summary and Event reports are run automatically each time the dialog is refreshed (by default, the refresh interval is every 5 seconds). If the Event report is chosen, you can watch the real-time progression of a job, observing, as they occur, the arrival of the various events, such as the job starting, running, and completing.

6-10

AutoSys Tutorial

Job Selection Dialog

To view a Summary Report for a job you have defined: 1. 2. In the Job List, single-click on the your_name_lesson4 job. This job becomes the currently selected job. In the Control area at the bottom of the window, locate the Reports area, and select the Summary radio button. This action displays the Summary Report.

To view an Event Report for a job you have defined: 1. 2. In the Job List, single-click on the your_name_depjob4 job. This job becomes the currently selected job. In the Control area at the bottom of the window, locate the Reports area, and select the Event radio button. This action displays the Event Report.
6

Alarm Button
The Alarm button serves both as an indicator that a new alarm has been detected and as a way to display the Alarm Manager dialog. When a new alarm occurs (either operator- or system-generated), the Alarm button turns red. When you click the button, its color returns to green and the Alarm Manager dialog is displayed. Note that you can invoke the Alarm Manager by clicking the button, even when the Alarm button is green.

Exit Button
The Exit button is used to terminate the Job Activity Console, including the Alarm Manager, if it is displayed. When you click this button, a verification dialog asks you to confirm the exit before closing the console.

Job Selection Dialog


The Job Selection dialog provides a way for you to specify which jobs you want to view, filtering out all other jobs. It lets you specify the jobs you want to view by name, job status, and machine. To display the Job Selection dialog: From the Job Activity Console, choose the Select Jobs option from the View menu. The Job Selection dialog appears, as shown in Figure 6-4.

Monitoring and Managing AutoSys 6-11

Job Selection Dialog

Figure 6-4 Job Selection Dialog

Specifying a Job
Selecting All Jobs will display in the Job Activity Console all the jobs defined to AutoSys for that instance. You can filter which jobs to display by specifying a job name, job status, or the machine on which the job is to run. When specifying a job name in the Job Name field, you can either enter the entire name or you can enter a partial name with the asterisk * wildcard character. You can use this wildcard in more than one character position. For example, the *a* string would match all job names that have an a in them. In a similar fashion, you can specify a Box Job name in the Box Name field to select a box and all the jobs in the box. When boxes and their contained jobs are displayed in the Job List, each nested level is indented two spaces. When specifying a Box Job name, you can also include the wildcard character. The Box Levels field governs how many levels of nesting is displayed for each matched box. The default setting of All displays all jobs, and all levels of nesting inside each job. If you want to view only the Box Jobs themselves, enter 0 in the Box Levels field. If you want to view the top-level boxes and only the first-level nesting of jobs and boxes inside each box, enter 1 in the Box Levels field.

6-12

AutoSys Tutorial

Job Selection Dialog

To Display the jobs that you have already defined: 1. 2. 3. In the Job Name field, enter the following: your_name_* Click the Apply button. In the Job Activity Console (behind the dialog), check the Job List and notice that all the jobs beginning with your_name are listed.

To Display the Box Job that you have already defined: 1. 2. 3. In the Box Name field, enter the following: your_name_box Leave the default setting of All Box Levels. Click the Apply button. In the Job List (behind the dialog), notice that the job named

your_name_box is listed, as well as the names of the jobs you placed


inside this box. If you are using AutoSys on NT, this Job List would look similar to that shown in Figure 6-5.

Figure 6-5 Displaying a Box Job Specifying Jobs by Status


From the Job Selection dialog, you can select jobs based on their current status, such as STARTING, RUNNING, or INACTIVE. You can select any combination of statuses. The default behavior is to display all statuses.

Specifying Jobs by Machine


From the Job Selection dialog, you can select jobs based on the name of the machine on which they are defined to run. On the right side of this dialog is a list of all the machines that are known to AutoSys for that instance. That is, all machines that are referenced in a job or virtual machine definition, or which have run an AutoSys job. From this list, you can choose one, several, or all machines (all machines is the default setting).

Monitoring and Managing AutoSys 6-13

Job Selection Dialog

Sorting the Specified Jobs


The Job Selection dialog lets you specify the order in which the jobs should be listed. You can select one of the following sort criteria:
I

Start Time Sort jobs by the start time for the last (most recent) execution of the job. End Time Sort jobs by the ending time for the last (most recent) execution of the job. Job Name Sort jobs by name in ascending alphanumeric order. Job Status Sort jobs by their current status in ascending alphabetical order. Machine Name Sort jobs by the name of the machine on which they are defined to run, in ascending alphabetical order. Unsorted Display jobs in the order in which they were created, which corresponds to the order in which they exist in the database. This is the default setting.

I I I

Note:

You should choose the Unsorted option when selecting jobs by Box Name, because the creation order can control the order in which they are started. If a Box Jobs contained jobs do not have a specified starting condition, the Event Processor will start the Box Job based on its starting condition, and then start the contained jobs in their creation order. Therefore, in this situation, the Unsorted criteria can provide the starting order information for jobs in a box.
6

Setting the Job Selection Criteria


To make the job selection criteria take effect: 1. 2. Select the desired selection criteria. To apply the sorting and dismiss the dialog, click OK.

Note:

If you click the Apply button, the sorting criteria is changed, but the Job Selection dialog stays open. If you click Cancel, the changes to the sorting criteria are not made, and the Job Selection dialog closes.

6-14

AutoSys Tutorial

AutoSys Alarms

AutoSys Alarms
Alarms are special events that notify you about important situations that require your attention. For example, if a set of jobs are dependent on the arrival of a file, and the file is long overdue, someone should investigate the situation and resolve the problem. These are some important aspects of alarms:
I

Alarms are informational only. Any action taken due to a problem is initiated by a separate action event. Alarms are system messages about a detected problem. Alarms are sent through the AutoSys system as an event.
6

I I

Preparation
In order to view an alarm, you will modify an existing job definition to force it to generate an alarm. To do this, you need to perform the steps described in the following sections. In the Job Activity Console: 1. 2. In the Job List, select the your_name_lesson4 job. Access the Job Definition dialog by clicking the Job Definition button in the Control area at the bottom of the window. This action displays the Job Definition dialog with your_name_lesson4 as the selected job.

At the Job Definition Dialog: 3. In the Command to Execute field, replace the current entry with the following: bad_command This will cause the job your_name_lesson4 to fail. As a result, an alarm called JOBFAILURE will be generated. 4. 5. At the top of the Job Definition dialog, click the Save button to save the changed job definition to the AutoSys database. At the top of the dialog, click the Exit button.

At the Job Activity Console: 6. 7. In the Job List, ensure that the job your_name_lesson4 is still the currently selected job. If you wan to view an Event Report while this job runs, select the Event radio button in the Reports area. Also ensure the Freeze Frame button is deselected. Then, when the job runs, the events are displayed in the Event Report area.

Monitoring and Managing AutoSys 6-15

AutoSys Alarms

8.

In the Control area at the bottom of the window, click the Force Start Job button, and confirm the action. This process overrides all starting conditions and starts the your_name_lesson4 job immediately.

This job will not be able to run the bad_command, and thus it will fail and generate an alarm. The Alarm button at the lower-right of the console should change from green to red indicating that an alarm has been received. You can view the alarm using the Alarm Manager dialog.

6-16

AutoSys Tutorial

Alarm Manager Dialog

Alarm Manager Dialog


The Alarm Manager allows you to do the following:
I I I

View alarms as they arrive Acknowledge alarms Change the alarm status from Open to Acknowledged or Closed

This dialogs features provide a useful tracking mechanism for all the alarms issued on your system. To display the Alarm Manager dialog: In the lower-right corner of the Job Activity Console, click the Alarm button. The Alarm Manager dialog appears, as shown in Figure 6-6.

Figure 6-6 Alarm Manager Dialog

Monitoring and Managing AutoSys 6-17

Alarm Manager Dialog

Menu Bar and Regions


The Alarm Manager dialog has a menu bar and the following three regions:
I

Alarm List Displays a list of alarms. By default, all Open and Acknowledged alarms are shown. The alarms in the Closed State can be displayed also, if indicated in the Alarm Selection dialog. Currently Selected Alarm Displays the currently selected alarm, the response to the alarm (if one was entered) and the alarm state. Control Provides control functions for the Alarm Manager screen.
6

Menu Bar
The Alarm Manager menu bar, at the top of the dialog, contains the View and Options menus. ViewProvides two options. The Select Alarms option displays the Alarm Selection dialog (discussed on page 6-20). The Reset to Defaults option resets the alarm selection criteria to their default settings and updates the Alarm Manager dialog accordingly. OptionsContains the Sound On option, which you can toggle on or off by selecting the option. When on, this feature plays sound clips associated with alarms whenever a new alarm is generated.

Alarm List
The Alarm List region of the dialog displays a list of all the alarms that are currently in the system, subject to your selection criteria. The default behavior is to display all Open and Acknowledged alarms of any type, regardless of the time they were generated. Each entry in the Alarm List corresponds to a single alarm and shows the following information:
I I I I I

Alarm type. Name of the job for which the alarm was generated. Date and time the alarm was generated. Current state of the alarm. Any comment associated with the alarm at the time it was generated. These comments can be system-generated (by the Event Processor) or user-generated (a comment attached to a sendevent command).

The Alarm List is chronological; the newest alarms appear at the top of the list, older ones appear below.

6-18

AutoSys Tutorial

Alarm Manager Dialog

You can select any alarm in the Alarm List by single-clicking on it. This action causes the alarm to become the currently selected alarm, and the window displays more detailed information about it in the Currently Selected Alarm region. To inspect the alarm for the failure of your_name_lesson4: 1. 2. Check the Alarm List for the JOBFAILURE alarm that was just generated for your_name_lesson4. It should be at or near the top of the Job List. In the Alarm List, single-click on the JOBFAILURE alarm for your_name_lesson4.
6

Currently Selected Alarm


The Currently Selected Alarm region of the dialog displays the currently selected alarm, and lets you enter a response in the Response edit box. The Response edit box accepts multiple lines of text. The entered text is automatically word-wrapped, with lines breaking at appropriate spaces. You can use the mouse to edit text. In addition, you can use the arrow and backspace keys as well as the <Tab> and <Enter> keys. The User field, beneath the Response edit box, shows the user who invoked the Alarm Manager. This read-only field shows which user responded to the alarm field. The Alarm State region lets you change the alarm state to Acknowledged or Closed. Once an alarm is changed from the Open state, you cannot put it back in the Open state. To register a response and change the state of the alarm generated for your_name_lesson4: 1. 2. 3. In the Response edit box, enter the following comment: Alarm generated intentionally for tutorial. In the Alarm State area, single-click on the Acknowledged radio button. At the bottom-center of the dialog, click Apply. This action saves the alarm to the database, but the dialog remains open. Note that typically the Apply button is used to register changes. This approach allows you to keep the Alarm Manager open to continue monitoring alarms.

Monitoring and Managing AutoSys 6-19

Alarm Selection Dialog

Control
The Control region at the bottom of the of the Alarm Manager dialog contains the following buttons:
I

Freeze Frame Suspends or resumes, when toggled, the automatic refreshing of the Alarm Manager dialog. Select Job Makes the job associated with the currently selected alarm the currently selected job in the Job Activity Console. New Alarm Turns red to alert you when a new alarm arrives.

Alarm Selection Dialog


The Alarm Selection dialog lets you control which alarms are displayed. Alarms can be selected by type of alarm, state of alarm (Open, Acknowledged, or Closed), and by the date and time the alarm occurred. To display the Alarm Selection dialog select the Select Alarms option from the View menu at the top of the Alarm Manager dialog. The Alarm Selection dialog appears with the default settings, as shown in Figure 6-7.

Figure 6-7 Alarm Selection Dialog


The Alarm Selection dialog is divided into the following three regions:
I

Alarm Selection Area Allows you to specify what types of alarms to display based on alarm types, alarm states, or the times the alarms were generated. Control Area Provides buttons to initiate the alarm selection, and to close the dialog.

6-20

AutoSys Tutorial

Alarm Selection Dialog

Select by Type
In the Select by Type region of the dialog, a list of all possible alarm types is displayed. From this list, you can select one, several, or all types of alarms. The default is to select all alarm types. To select a contiguous group of alarms: Single-click on the first alarm then press <Shift>, and single-click on the last alarm to be selected. To select a noncontiguous group of alarms: Single-click on the first alarm then press <Control>, and single-click on additional alarms in any order. To deselect an alarm: Press <Control> and single-click on the alarm. To select only the alarms that are of the type JOBFAILURE: 1. 2. In the Select by Type region, in the list box, single-click on JOBFAILURE. At the bottom-left of the dialog, click OK. This action closes the Alarm Selection dialog, and all jobs with a JOBFAILURE alarm appear in the Alarm Manager Alarm List. The alarm for the job your_name_lesson4 should be listed.

Select by State
You can also select alarms by the state of the alarm. You can select one or more states by toggling on the Open, Acknowledged, or Closed buttons. You can select the All States button to select all states. The default is to display all Open and Acknowledged alarms.

Select by Time
By default, alarms are shown regardless of the time they were generated. You can choose to display only alarms that were generated during a specific date and time window. Fields are provided to specify a From Date, From Time, To Date, and To Time. You can specify dates without times. However, you cannot specify times without dates. As shown in Figure 6-7 on page 6-20, the current system date and time are automatically filled in for your convenience.

Monitoring and Managing AutoSys 6-21

Review

To exit the Operator Console and complete this lesson: 1. 2. 3. At the Alarm Manager dialog, at the bottom-left corner, click OK. At the Job Activity Console, at the bottom-right corner, click Exit. In the dialog that appears asking your to confirm the exit, click Yes.

Review
I

The Operator Console refers to a collection of dialogs for monitoring and managing AutoSys jobs in real-time. You can view AutoSys jobs, whether they are currently active or not. You start the Operator Console by clicking the Ops Console button in the GUI Control Panel (or by entering autocons at the command prompt). When you first access the Operator Console, the Job Activity Console is displayed. From this console you can view AutoSys jobs along with a brief description and the current status. In addition, you can access dialogs to view the job definition and job dependencies. The Job Selection dialog lets you specify which jobs you want to view, filtering out all other jobs. You can select jobs by name, job status, and machine on which the job is defined to run. You can use job selection criteria at any time to control which jobs you want to view based on various parameters such as current job state, job name, and the machine on which the job is defined to run. You can select any job in the Job Activity Console to make it the currently selected job. The console displays more detailed information about the job in the Currently Selected Job region. You can initiate events on the currently selected job. In addition, you can access the Job Definition dialog directly from this console, allowing you to view the entire job definition and even edit it (if the required permissions are set). The Report region in the Job Activity Console displays a real-time report of the current (or most recently completed) run of the currently selected job. The Send Event dialog is accessed from the Job Activity Console. It provides the means to send events that can be sent manually with AutoSys. The Alarm Manager is accessed from the Job Activity Console. It allows you to view alarms as they arrive, acknowledge them, and change their status from Open to Acknowledged or Closed. The Alarm Selection dialog lets you control which alarms are displayed in the Alarm Manager dialog. Alarms can be displayed by type of alarm, state of alarm, and by the date and time the alarm occurred.

6-22

AutoSys Tutorial

See Also

See Also
I

For more information on the Operator Console, refer to the AutoSys User Manual for your platform. For information on how to associate commands with the buttons on the Job Activity Console, refer to the AutoSys User Manual for your platform. For information on customizing other aspects of the Operator Console, refer to the AutoSys User Manual for your platform. For information on job executing permissions, refer to Chapter 2 in the AutoSys User Manual for your platform.

Monitoring and Managing AutoSys 6-23

Lesson

Queuing and Load Balancing

This lesson describes how to define real and virtual machines in order to balance job loads across physical machines. Topics to be Covered:
I I I I I

Topic Approach: Conceptual Conceptual Conceptual Conceptual Conceptual

Real Machines Virtual Machines Defining Real Machines Defining Virtual Machines Job Load Balancing

Estimated Time:

30 Minutes

Introduction
AutoSys provides both queuing and load balancing as a way to distribute jobs to machines with sufficient processing power to run them. This is done by defining to AutoSys both real and virtual machines on which you will be running jobs. This lesson explains how to accomplish this.

Queuing and Load Balancing 7-1

Real Machines

Real Machines
In the AutoSys environment, a real machine is any machine that has:
I

Been identified in the appropriate network database so that AutoSys can access it. For UNIX, this is a physical CPU that has identified in /etc/hosts; for NT, this is a network host that is accessible over the network using the TCP/IP protocol. Undergone a Remote Agent software installation, and a client license key installation, so that AutoSys can run jobs on it.

The above two conditions are all that is required for a real machine to run AutoSys jobs. However, for AutoSys to perform intelligent load balancing and queuing while executing jobs, it needs to know the relative processing power of the various real machines. You can define the real machines to AutoSys and specify these values. In addition, AutoSys provides both load balancing and queuing by way of the logical construct called virtual machines.

Virtual Machines
A virtual machine is comprised of two or more real machines, in whole or in part (or a combination of both). All real machines within a virtual machine must be of the same type, either NT or UNIXnot a mix of the two types. By defining virtual machines to AutoSys, and then submitting jobs to run on those machines, you can implement runtime resource policies that AutoSys can execute in a multi-machine environment.

Defining Machines to AutoSys


You define both real and virtual machines to AutoSys by using machine attribute statements within a JIL script. The following JIL sub-command defines a real or virtual machine to AutoSys: insert_machine: machine_name The following JIL machine attributes are used when defining machines:
I

type Can be either r for UNIX real, v for UNIX virtual, or n for NT (real or virtual). machine Specifies a real machine name to be inserted in a virtual machine. max_load For real machines only, used for load balancing. factor For real machines only, used for load balancing.

I I I

7-2

AutoSys Tutorial

Defining Machines to AutoSys

You need to define real machines to AutoSys only if they fit into one of the following categories:
I

Require a max_load or factor attribute to be set for them. (These attributes are discussed in the next sections.) Are to be included in a virtual machine.

Conversely, virtual machines must be defined before they can be used. Load balancing and queuing can be done only if real and virtual machines have been defined to AutoSys using the JIL machine attribute statements mentioned above. The max_load and factor attributes are used when defining real machines, and they are required if you want to implement load balancing and queuing.

Specifying Machine Load (max_load)


The max_load attribute can be defined only for real machines. It describes how much of a load can be placed on a real machine, and it is specified with an arbitrary unit called a load unit. Any weighting scheme desired by the user can be used. For example, a load unit with a range of 10-100 would specify that machines with limited processing power are expected to carry a load of only 10, while machines with ample processing power can carry a load of 100. There is no direct relationship between the load unit value and any of the machines physical resources. Therefore, you should develop conventions that are meaningful to you. The max_load machine attribute is illustrated in Figure 7-1.

Job Attributes and Load Balancing and Queuing


For load balancing to work, every defined job that will impact the load on a machine must be assigned a job_load job attribute, which defines the relative load the job will place on a machine. Thus, a machines current load can be tracked, and overloading of a machine can be prevented. For example, if the max_load on a machine is 100 and the job_load for one job is 10, then that job will use 10 percent of the machines resources. In addition, for job queueing to take place, the priority job attribute must also be assigned in the job definition. The priority attribute specifies the relative priority of all jobs queued for a given machine. Without this attribute set, a job will run immediately on a machine, and it will not be placed in the queue.

Queuing and Load Balancing 7-3

Defining Machines to AutoSys

Real Machine #1

Real Machine #2

Real Machine #3

15 MIPS

25 MIPS

50 MIPS

actual value

max_load

10
Will carry less of a load

50

80

arbitrary value

Will carry more of a load

Figure 7-1 Load Balancing using max_load

Specifying Relative Processing Power (factor)


The factor attribute can be defined only for real machines. It is another arbitrary value, but it describes the relative processing power of a machine. This attributes value is a real number that can contain a decimal. It is used to weigh available cycles on one machine against that of another. In fact, when AutoSys checks the available cycles on each machine, it multiplies the percent of free CPU cycles by the factor in order to determine which machine has more relative processing power available, as shown in Figure 7-2. Therefore, the factor value is typically a number between 0.0 and 1.0.
Real Machine #3 Real Machine #2 Real Machine #1

15 MIPS

50 MIPS

25 MIPS

available free cycles factor relative processing power

2 .15 .3
Can carry least load

1 .50 .5

4 .25 1
Can carry greatest load

Figure 7-2 Load Balancing using factor

Using max_load and factor


The max_load attribute is primarily intended to limit the loading of a machine. As long as a jobs load will not cause a machines max_load to be exceeded, this attribute does not enter into the decision of where to run the job. Conversely, the factor attribute is primarily intended to decide between machines for running a job (when more than one machine is available).

7-4

AutoSys Tutorial

Defining Real Machines

If these attributes are not specified in a real machine definition, they will default to the values shown here:

max_load: none /* no limit */ factor: 1.0


Note: A virtual machine is comprised of real machines. Therefore, you do not

specify max_load and factor attributes explicitly in a virtual machine definition. They are specified in the definitions of the real machines that make up the virtual machine.

Defining Real Machines


To define real machines to AutoSys, follow these basic steps: 1. 2. 3. Assign a machine name. This value must be the machines valid hostname. Assign a machine type, either r for real UNIX, or n for NT. If you want to implement load balancing, assign a max_load and a factor attribute value.

For example, to define a UNIX machine named ferrari, with a max_load of 100 and a factor of .9, you would submit the following JIL statements at a jil prompt:

insert_machine: ferrari type:r max_load: 100 factor: .9

Deleting Real Machine Definitions


To delete a real machine definition, use the following JIL sub-command at the jil prompt:

delete_machine: ferrari
This example deletes the real machine definition for the machine named ferrari.

Queuing and Load Balancing 7-5

Defining Virtual Machines

Defining Virtual Machines


To define a virtual machine to AutoSys, you must follow these basic steps: 1. 2. 3. Assign a machine name. Assign a machine type, either v for virtual UNIX or n for virtual NT. Specify the real machines that will make up the virtual machine.

A virtual machine is the combination of two or more real machines. It can be a group of machines, a subset of a machine, or both. Do not assign the max_load and factor attributes to a virtual machine. You assign these attribute values to real machines only. The following example JIL statements define an NT virtual machine named modena, which is comprised of three real machines named ferrari, lambo, and cobra. This virtual machine is illustrated in Figure 7-3.

insert_machine: modena type: n machine: ferrari machine: lambo machine: cobra


modena Real Machine #1 Real Machine #2 Real Machine #3

hostname

ferrari

lambo

cobra

Figure 7-3 Virtual Machine modena

Deleting Virtual Machines


You can delete real machines from a virtual machine definition, and you can delete the virtual machine definition itself. To remove a real machine component from a virtual machine, you specify the virtual machine and the component you want to remove. The following JIL statements remove the real machine named lambo from the virtual machine named modena:

delete_machine: modena machine: lambo

7-6

AutoSys Tutorial

Job Load Balancing

The definition for the real machine lambo remains intact; it is simply removed from the virtual machine modena. To delete a virtual machine, you do not specify any of the component real machines. The following JIL statement deletes the virtual machine named modena, and all of its components:

delete_machine: modena

Job Load Balancing


When you define a Command Job, you use the jobs machine attribute to specify the machine on which the job will run. By specifying a virtual machine, or a list of real machines, rather than a single real machine, you can implement simple load balancing. When load balancing is implemented, AutoSys checks the current work load of the real machines defined in the virtual machine (or of the real machines in the specified list) and chooses the machine with the most available processing power to run a given job. In addition to load balancing, this feature is a useful way to ensure reliable job processing. For example, if one of the machines is down, AutoSys will simply run the job on another machine.

Load Balancing using Virtual Machines


The following example JIL script shows a job defined to run on an NT virtual machine named modena:

insert_job: test_load machine: modena command: echo Test Load Balancing job_load: 50 priority: 1
When a job is ready to start running, AutoSys will determine which of the real machines specified in the virtual machine will be used to run the job. To determine this, AutoSys will consider two things:
I I

The max_load defined for each real machine. The factor defined for each real machine.

Queuing and Load Balancing 7-7

Job Load Balancing

max_load
In this example, AutoSys will not use any of virtual modenas component machines that have a max_load of less than 50, because the test_load job has a job_load of 50. In addition, AutoSys would eliminate all machines that cannot carry that load. That is, if a machine has a max_load of 80, but is currently running a job with a job_load of 60, AutoSys would not use it to run the job at this time.

factor
Once it determines which machines do have ample load units available, AutoSys would choose the machine to run on based solely on available processing power. To accomplish this, AutoSys determines the percentage of CPU cycles available and multiplies it by the machines factor value. The machine with the largest result is selected as the machine with the most relative processing cycles available.

Load Balancing using a List of Real Machines


Instead of specifying a virtual machine, you can specify a list of real machines in the jobs machine attribute, as shown below: machine: ferrari, lambo, cobra When specifying a list of real machines, all machines must be NT or UNIX, not a combination of the two.

Example of Load Balancing


Figure 7-4 shows how AutoSys determines which machine will be used to run a job. For simplicity, each machine in this example has enough load units available to run the job, so AutoSys calculates the percentage of CPU cycles available and multiplies it by the machines factor value. AutoSys selects the machine with the largest result as the machine with the most relative processing cycles available.

7-8

AutoSys Tutorial

Review

Virtual Machine: modena


Real Machine #1 Real Machine #2 Real Machine #3

hostname available free cycles factor relative processing power

ferrari

lambo

cobra

4 .5 2

6 .5 3

2 1 2

Chosen to run the job

Figure 7-4 Determining Relative Processing Power

Review
I

AutoSys provides ways to define both real machines and virtual machines in order to handle load balancing and queuing. A virtual machine is the combination of one or more real (physical) machines, in whole or in part. For AutoSys to perform intelligent load balancing, it needs to know the relative processing power of the various real machines. Two machine attributes are used to characterize real machines: max_load and factor. The max_load attribute describes how much of a load should be placed on a machine, and is specified with an arbitrary value called a load unit. The factor attribute describes the relative processing power of a machine, with an arbitrary value. This attributes value is a real number that can contain a decimal. The factor attribute is used to weigh available cycles on one machine against that of another machine. You use JIL to define both real and virtual machines to AutoSys. There are two main JIL sub-commands for defining machines: insert_machine and delete_machine.

Queuing and Load Balancing 7-9

See Also

In order to implement simple load balancing, you must specify the following attributes in the job definition: job_load Specifies the relative load that a job will put on a machine. priority Specifies the relative priority that a job has, relative to the other jobs in the queue for a given machine. machine Specifies a virtual machine or list of real machines.

I I

See Also
I

For more information on job load balancing and queues, refer tp the AutoSys User Manual for your platform. For more information about the JIL sub-commands and attributes pertaining to machines, refer to the AutoSys User Manual for your platform. For more information about the JIL sub-commands and attributes for defining jobs, refer to the AutoSys User Manual for your platform.

7-10

AutoSys Tutorial

Index

Symbols
$AUTOUSER/config.$AUTOSERV 1-7

A
ACTIVATED status 2-9 Advanced Features dialog 4-6 Alarm Manager dialog 6-15 Alarm List region 6-17 Control region 6-18 Currently Selected Alarm region 6-18 Freeze Frame button 6-18 menu bar 6-17 New Alarm button 6-18 Select Job button 6-18 Alarm Selection dialog 6-19 Select by State region 6-20 Select by Time region 6-20 Select by Type region 6-19 alarms 6-14 Alarm Manager dialog 6-15 Job Activity Console 6-11 managing 6-15 selecting 6-18 viewing all 6-17 viewing by state 6-20 viewing by time 6-20 viewing by type 6-19

attributes, job days_of_week 5-8 file to watch for 5-4 JIL types 5-3 job_load 7-3 machine to run on 5-3 name 5-3 priority 7-3 start_times 5-8 starting conditions 5-3 type 5-3 attributes, machine factor 7-2, 7-4 max_load 7-2, 7-3 type 7-2 autocons 6-2 autoping 1-8 autorep 1-8, 2-9 autosc 4-2 AUTOSERV 1-7 AUTOSYS 1-6 AutoSys Administrator 1-7 alarms 6-14 commands 1-8 Console Utilities 1-3 database 1-3 defined 1-1 documentation Preface-1 environment variables 1-6 Event Processor 1-3, 1-5

Index

Event Server 1-3 Graphical User Interface, see GUI instance, defined 1-3 machines 1-2 Remote Agent 1-3, 1-5 software components 1-3 AUTOUSER 1-7

concepts and skills Preface-2 conditions date/time defining with GUI 4-11 defining with JIL 5-8 dependency defining with GUI 4-13 defining with JIL 5-10 starting defining with GUI 4-10 defining with JIL 5-3, 5-8 configuration file AutoSys 1-7 Console Utilities 1-3 Control Panel, GUI 4-2 conventions, used in manual Preface-4

B
Box Jobs 3-5 defined 2-8 defining with GUI 4-20 job stream, advanced example 3-7 job stream, examples 3-5

C
Calendar Manager dialog 4-2 chk_auto_up 1-8 client machine 1-2 Command Jobs defined 2-6 defining with GUI 4-5 defining with JIL 5-5 commands 1-8 autocons 6-2 autoping 1-8 autorep 1-8, 2-9 autosc 4-2 chk_auto_up 1-8 delete_box 5-3 delete_job 5-3 delete_machine 7-6, 7-7 insert_job 5-3 insert_machine 7-2 JIL 5-3 JIL, sub-commands 2-2 override_job 5-3 sendevent 2-4 update_job 5-3

D
database AutoSys, see Event Server environment variables 1-7 date/time conditions 2-3 defining with GUI 4-11 specifying with JIL 5-8 Date/Time Options dialog 2-3, 4-11 days_of_week job attribute 5-8 defining Box Jobs with GUI 4-20 Command Jobs with GUI 4-5 Command Jobs with JIL 5-5 date/time conditions with GUI 4-11 date/time conditions with JIL 5-8 dependent jobs with GUI 4-13 dependent jobs with JIL 5-10 File Watcher Jobs with GUI 4-15 jobs with GUI 4-3 jobs with JIL 5-1 machines 7-2 starting conditions with GUI 4-10 starting conditions with JIL 5-8

AutoSys Tutorial

delete_box 5-3 delete_job 5-3 delete_machine 7-6, 7-7 deleting jobs with GUI 4-25 jobs with JIL 5-13 real machines 7-6 virtual machines 7-7 Dependent Jobs dialog 6-9 dependent jobs, viewing 6-9 documentation, AutoSys Preface-1 DSQUERY 1-7

File Watcher Jobs defined 2-7 defining with GUI 4-15 file to watch for 5-4 job stream example 3-3 files configuration, AutoSys 1-7 interfaces, Sybase 1-7 Freeze Frame Alarm Manager dialog 6-18 Job Activity Console 6-10

G
GUI 2-1, 4-1 Control Panel 4-2, 6-2 Date/Time Options dialog 4-11 defined 1-2 defining date/time conditions with 4-11 defining dependent jobs with 4-13 defining jobs with 4-1 defining starting conditions with 4-10 Job Definition dialog 4-2 Monitor/Browser dialog 4-2 Operator Console 4-2, 6-1 Send Event dialog 4-8 starting 4-2

E
environment variables AUTOSERV 1-7 AUTOSYS 1-6 AUTOUSER 1-7 database 1-7 DSQUERY 1-7 Oracle 1-7 Sybase 1-7 environment, AutoSys 1-6 Event Processor 1-3, 1-5 Event Server 1-3, 1-4 events 4-8 defined 1-4 reports, viewing 6-10 Send Event dialog 6-7 sending with JIL 5-7 sending with Job Activity Console 6-6

I
INACTIVE status 2-9 insert_job 5-3 insert_machine 7-2 instance, AutoSys 1-3 interfaces file (for Sybase) 1-7

F
factor machine attribute 7-2, 7-4, 7-5, 7-6 FAILURE status 2-9

Index

J
JIL commands 2-2 defined 1-2 defining date/time conditions with 5-8 defining dependent jobs with 5-10 defining jobs with 2-1, 5-1 defining machines with 7-2 defining starting conditions with 5-8 deleting jobs with 5-13 job attribute types 5-3 sub-commands 5-3 syntax rules 5-4 Job Activity Console 6-3 Action Area 6-6 Alarm button 6-11 Alarm Manager dialog 6-15 Control Area 6-6 control buttons 6-9 Currently Selected Job region 6-5 Dependent Jobs button 6-9 Exit button 6-11 Freeze Frame button 6-10 Job Definition button 6-9 Job List region 6-4 Job Selection dialog 6-11 menu bar 6-4 Reports, Event 6-10 Reports, None 6-10 Reports, Summary 6-10 Send Event dialog 6-7 Job Definition dialog 4-2, 4-3, 6-9 Advanced Features dialog 4-6 Basic Information region 4-4 Box Completion Conditions region 4-4 Command and File Watcher Information region
4-4

specifying job selection criteria 6-14 specifying jobs by machine 6-13 specifying jobs by status 6-13 job streams defined 3-1 examples box job 3-5 date/time 3-2 file watcher 3-3 job_load job attribute 7-3 jobs ACTIVATED status 2-9 box 3-5 advanced job stream example 3-7 defined 2-8 defining with GUI 4-20 job stream example 3-5 command defined 2-6 defining with GUI 4-5 defining with JIL 5-5 conditions, dependency 4-10 date/time conditions defining with GUI 4-11 defining with JIL 5-8 date/time dependencies 3-2 date/time running options 2-3 defined 1-1 defining with GUI 2-1, 4-1 defining with JIL 2-1, 5-1 definition dialog 4-2, 4-3 definitions 1-5, 2-1 deleting with GUI 4-25 deleting with JIL 5-13 dependent defining with GUI 4-13 defining with JIL 5-10 dependent, viewing 6-9 event reports, viewing 6-10 FAILURE status 2-9 file to watch for attribute 5-4 file watcher defining with GUI 4-15 file watcher stream example 3-3 file watcher, defined 2-7

File to Redirect to Standard Output field 4-7 Starting Parameters region 4-4 Job Information Language, see JIL Job Selection dialog 6-11 Job Name field 6-12 sorting jobs 6-13

AutoSys Tutorial

INACTIVE status 2-9 JIL attribute types 5-3 JIL sub-commands 2-2 Job Activity Console, listed in 6-4 Job Definition dialog 4-3 machine attribute 5-3 name attribute 5-3 nested 3-5 ON_HOLD status 2-9 ON_ICE status 2-9 QUE_WAIT status 2-9 queuing 7-3 RESTART status 2-9 running 2-4, 4-7, 5-7 RUNNING status 2-9 saving definitions with JIL and GUI 2-2 sorting order for viewing 6-13 starting attribute 5-3 starting conditions 2-3 defining with GUI 4-10 defining with JIL 5-8 STARTING status 2-9 states 2-9 status 2-9 in Job Activity Console 6-10 streams defined 3-1 examples 3-2 SUCCESS status 2-9 summary reports, viewing 6-10 TERMINATED status 2-9 type attribute 5-3 types 2-6 viewing by machine 6-13 viewing by name 6-12 viewing by sorting order 6-13 viewing by status 6-13 viewing selection 6-14 with starting conditions 2-4 without starting conditions 2-4

load balancing 7-1, 7-7 job attributes required for 7-3 machine attributes required for 7-3 machine factor 7-4 maximum load on machine 7-3

M
machines client 1-2 defining using insert_machine 7-2 deleting real 7-6 deleting virtual 7-7 distributing jobs among 7-1 factor attribute 7-2, 7-4 job attribute 5-3 job_load job attribute 7-3 load balancing 7-7 max_load attribute 7-2, 7-3 priority job attribute 7-3 real 7-2 real, defining 7-5 real, deleting definition 7-6 server 1-2 type 7-2 viewing jobs by 6-13 virtual 7-2 virtual, defining 7-6 virtual, deleting definitions 7-7 virtual, example 7-6 manual, conventions used in Preface-4 max_load machine attribute 7-2, 7-3, 7-5, 7-6 maximum system load 7-3 Monitor/Browser dialog 4-2

N
nested jobs 3-5

L
lesson content and flow Preface-3 lesson summaries Preface-3

Index

O
ON_HOLD status 2-9 ON_ICE status 2-9 Operator Console 4-2, 6-1 defined 1-9 starting 6-2 Operator Console. See also Job Activity Console Oracle environment variables 1-7 tnsnames.ora file 1-7 override_job 5-3

S
Send Event dialog 4-8, 6-7 illustration 4-9 sendevent 2-4 server machine 1-2 software components of AutoSys 1-3 SQL.INI file (for Sybase) 1-7 start_times job attribute 5-8 starting conditions 5-3 jobs 2-3 STARTING status 2-9 starting the GUI 4-2 states, job 2-9 status job, in Job Activity Console 6-10 sorting jobs by 6-13 status, job ACTIVATED 2-9 FAILURE 2-9 INACTIVE 2-9 ON_HOLD 2-9 ON_ICE 2-9 QUE_WAIT 2-9 RESTART 2-9 RUNNING 2-9 STARTING 2-9 SUCCESS 2-9 TERMINATED 2-9 SUCCESS status 2-9 Sybase DSQUERY environment variable 1-7 environment variables 1-7 interfaces file 1-7 SQL.INI file 1-7 system load, maximum 7-3

P
priority job attribute 7-3

Q
QUE_WAIT status 2-9 queuing jobs 7-3

R
real machines 7-2 defining 7-2, 7-5 deleting 7-6 type 7-2 Remote Agent 1-3, 1-5 reports events, viewing 6-10 job summary, viewing 6-10 RESTART status 2-9 rules, JIL syntax 5-4 running jobs 2-4, 4-7, 5-7 RUNNING status 2-9

AutoSys Tutorial

T
TERMINATED status 2-9 tnsnames.ora file (for Oracle) 1-7 tutorial concepts and skills Preface-2 estimated times Preface-2 lesson content and flow Preface-3 lesson summaries Preface-3 process Preface-2 type machine attribute 7-2

U
update_job 5-3

V
variables, environment 1-6 virtual machines 7-2 defining 7-2, 7-6 deleting 7-7 example 7-6 type 7-2

W
working environment 1-6

Index

You might also like