Top Banner
ibm.com/redbooks Implementing TWS Extended agent for Tivoli Storage Manager Vasfi Gucer Henry Daboub Warren Gill Denise Kikumoto Tina Lamacchia Insider’s guide to writing a TWS Extended agent Ready-to-use solution for TSM and TWS integration TSM Extended agent code included
120

Implementing tws extended agent for tivoli storage manager sg246030

Dec 05, 2014

Download

Technology

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Implementing tws extended agent for tivoli storage manager   sg246030

ibm.com/redbooks

Implementing TWS Extended agent for Tivoli Storage Manager

Vasfi GucerHenry Daboub

Warren GillDenise KikumotoTina Lamacchia

Insider’s guide to writing a TWS Extended agent

Ready-to-use solution for TSM and TWS integration

TSM Extended agent code included

Page 2: Implementing tws extended agent for tivoli storage manager   sg246030
Page 3: Implementing tws extended agent for tivoli storage manager   sg246030

Implementing TWSExtended agent for Tivoli Storage Manager

March 2001

SG24-6030-00

International Technical Support Organization

Page 4: Implementing tws extended agent for tivoli storage manager   sg246030

© Copyright International Business Machines Corporation 2001. All rights reserved.Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subjectto restrictions set forth in GSA ADP Schedule Contract with IBM Corp.

First Edition (March 2001)

This edition applies to Tivoli Workload Scheduler 7.0 and Tivoli Storage Manager 4.1

Comments may be addressed to:IBM Corporation, International Technical Support OrganizationDept. JN9B Building 003 Internal Zip 283411400 Burnet RoadAustin, Texas 78758-3493

When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you.

Before using this information and the product it supports, be sure to read the general information in Appendix C, “Special notices” on page 89.

Take Note!

Page 5: Implementing tws extended agent for tivoli storage manager   sg246030

Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ixThe team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ixComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x

Chapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 TWS overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.1 Software configurations used for this redbook . . . . . . . . . . . . . . . 21.1.2 TWS concepts and terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1.3 TWS architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.4 Extended agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2 TSM overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.1 What are the benefits of a TSM Extended agent for TWS? . . . . . . 9

1.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Chapter 2. Extended agent functions . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2 Workstation definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Method options file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.4 Access method interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.4.1 Method command line syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4.2 Task options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.4.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.5 Method response messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.6 Execution and troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.6.1 Executing the method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.6.2 Killing a job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.6.3 Method troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Chapter 3. Case study - TSM Extended agent . . . . . . . . . . . . . . . . . . . 233.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Chapter 4. Sample scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434.1 Description of the scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

4.1.1 Database backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434.1.2 Backup device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.1.3 Backup volume history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644.1.4 Clean volume history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.1.5 Expiration process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.1.6 Reclamation process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

iii

Page 6: Implementing tws extended agent for tivoli storage manager   sg246030

4.1.7 Migration process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684.1.8 Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

4.2 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

Appendix A. TSW Extended agent for TSM source code. . . . . . . . . . . . 71

Appendix B. Using the additional material . . . . . . . . . . . . . . . . . . . . . . . 87B.1 Locating the additional material on the Internet . . . . . . . . . . . . . . . . . . . . 87B.2 Using the Web material. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

B.2.1 How to use the Web material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Appendix C. Special notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

Appendix D. Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93D.1 IBM Redbooks collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93D.2 Other resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93D.3 Referenced Web sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95IBM Redbooks fax order form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

Abbreviations and acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

IBM Redbooks review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

iv Implementing TWS Extended agent for Tivoli Storage Manager

Page 7: Implementing tws extended agent for tivoli storage manager   sg246030

Figures

1. Extended agent network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42. Extended agent processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53. Extended agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104. Requesting a backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245. Verifying that a backup was unsuccessful . . . . . . . . . . . . . . . . . . . . . . . . . 256. Backing up a storage pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267. Reclamation in the tape device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278. Migration process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299. Device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3010. Maestro (TWS) Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3411. Maestro (TWS) Composer window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3512. List of jobs scheduled on your server . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3613. Changing job definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3714. Maestro (TWS) Console Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3815. Jobs scheduled on TWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3916. Right-click to see the status of the job . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4017. Status of the job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4018. Maestro (TWS) Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4419. Select Jobs to create a new job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4520. Select the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4521. New Job window for database backup . . . . . . . . . . . . . . . . . . . . . . . . . . . 4622. Job definition window for Database Backup . . . . . . . . . . . . . . . . . . . . . . . 4723. List of jobs, including BACKUPDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4824. Selecting Schedules to add a new schedule . . . . . . . . . . . . . . . . . . . . . . . 4825. Creating a new schedule for database backup . . . . . . . . . . . . . . . . . . . . . 4926. Defining a new schedule for database backup . . . . . . . . . . . . . . . . . . . . . 5027. New schedule - backup db. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5028. On/Except window to definite the new schedule . . . . . . . . . . . . . . . . . . . . 5129. Options to define a new schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5230. Follows Sched/Job window for database backup . . . . . . . . . . . . . . . . . . . 5331. Opens Files window for database backup . . . . . . . . . . . . . . . . . . . . . . . . . 5432. Needs resources window for database backup . . . . . . . . . . . . . . . . . . . . . 5533. Jobs window for database backup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5634. Adding jobs to the Current Jobs list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5635. New schedule on the List of Schedules . . . . . . . . . . . . . . . . . . . . . . . . . . . 5736. Selecting Conman from the Maestro (TWS) Main Window . . . . . . . . . . . . 5837. BACKUPDB schedule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5938. Standard output for database backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5939. Checking the status of a job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6040. Stdlist for BACKUPDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

v

Page 8: Implementing tws extended agent for tivoli storage manager   sg246030

41. Job Definition window for storage pool backup . . . . . . . . . . . . . . . . . . . . . 6242. Job Definition window for backup device configuration . . . . . . . . . . . . . . . 6443. Job Definition window for backup volume history . . . . . . . . . . . . . . . . . . . 6544. Job Definition window for clean volume history . . . . . . . . . . . . . . . . . . . . . 6645. Job Definition window for the expiration process. . . . . . . . . . . . . . . . . . . . 6746. Job Definition window for the reclamation process . . . . . . . . . . . . . . . . . . 6847. Job Definition window for the migration process . . . . . . . . . . . . . . . . . . . . 6948. Job Definition window for restore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vi Implementing TWS Extended agent for Tivoli Storage Manager

Page 9: Implementing tws extended agent for tivoli storage manager   sg246030

Tables

1. Task types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162. Task options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

© Copyright IBM Corp. 2001 vii

Page 10: Implementing tws extended agent for tivoli storage manager   sg246030

viii Implementing TWS Extended agent for Tivoli Storage Manager

Page 11: Implementing tws extended agent for tivoli storage manager   sg246030

Preface

Tivoli Workload Scheduler (TWS) is Tivoli’s strategic, multiplatform distributed scheduling product, providing high-volume, complex scheduling capability. Although TWS provides native support for many platforms and applications, it is possible to extend its robust scheduling capabilities to cover additional platforms and applications. Writing an Extended agent accomplishes this.

This redbook will show you how to write a TWS Extended agent. The Extended agent allows you to schedule on platforms and applications for which TWS has no native agent. Using the Extended agent, you can integrate Tivoli Storage Manager (TSM) with TWS. TWS’s scheduling facility allows you to assign dependencies among TSM-scheduled tasks or to assign limits or priorities. By extending TWS to schedule these TSM tasks, you can take advantage of its advanced scheduling capabilities.

This redbook will be essential for those who will write a TWS Extended agent or who will use TWS to schedule TSM functions.

The team that wrote this redbook

This redbook was produced by a team of specialists from around the world working at the International Technical Support Organization (ITSO), Austin Center.

Vasfi Gucer is a Project Leader at the ITSO, Austin Center. He worked with IBM Turkey for 10 years and has been with the ITSO since January 1999. He has more than eight years of experience in systems management, networking hardware, and distributed platform software. He has worked on various Tivoli customer projects as a systems architect in Turkey and the U.S. Vasfi is also a Certified Tivoli Consultant.

Henry Daboub is currently a member of the Tivoli Customer Support GlobalResponse Team (GRT). The GRT provides on-site support to Tivolicustomers with an emphasis on large environments. Henry has more than 12years of experience in software development and support, and has supportedIBM workload management products since 1997.

Warren Gill is the Product Marketing Manager for TWS and Tivoli Operations Planning and Control. He has been a courseware designer and trainer for TWS and its predecessor Maestro, as well as a customer support engineer.

© Copyright IBM Corp. 2001 ix

Page 12: Implementing tws extended agent for tivoli storage manager   sg246030

Warren has been with Tivoli Systems since December 1997, when Tivoli acquired Unison Software. He has been using TWS since 1990.

Denise Kikumoto is an IT specialist working for IBM Brazil since May 1997. She is responsible for AIX server and Lotus Notes administration. She also has extensive experience with TSM. She holds a degree in systems analysis.

Tina Lamacchia has been in the IT realm for 18 years. Her career started with programming, and then administrating hundreds of UNIX systems. She has been with Tivoli Systems for more than three years. She has worked with TWS for two years and managed a TWS support team. Prior to joining Tivoli Systems, she was a TWS customer for three years and deployed the product set (including SAP Extended agent) in an Enterprise Systems Management (ESM) environment. Currently she is working in the GRT to assist ESM customers with various deployments in TWS and Tivoli Management Environment (TME).

Thanks to the following people for their invaluable contributions to this project:

Tivoli Systems, International Technical Support Organization, Austin CenterSergio Juri, Richard Harrison, Cesare Pagano

IBM, International Technical Support Organization, Austin CenterLeah Nelson

Comments welcome

Your comments are important to us!

We want our redbooks to be as helpful as possible. Please send us your comments about this or other redbooks in one of the following ways:

• Fax the evaluation form found in “IBM Redbooks review” on page 103 to the fax number shown on the form.

• Use the online evaluation form found at ibm.com/redbooks

• Send your comments in an Internet note to [email protected]

x Implementing TWS Extended agent for Tivoli Storage Manager

Page 13: Implementing tws extended agent for tivoli storage manager   sg246030

Chapter 1. Introduction

This redbook is designed to illustrate the implementation of a Tivoli Workload Scheduler (TWS) Extended agent. The implementation the redbook team designed facilitates a communication between TWS V7.0and Tivoli Storage Manager (TSM) V4.1 to initiate regularly scheduled tasks on the TSM server. TSM’s server-prompted scheduling facility allows us to initiate client backups on machines defined as TSM clients in server-prompted scheduling mode.

1.1 TWS overview

TWS is a multiplatform distributed scheduling system that provides high-volume, complex scheduling capability. A powerful scheduling language allows for precise coding of job streams with dependencies on other jobs, files, virtual resources, operator prompts, and jobs in other scheduling environments.

A Java-based graphical user interface (GUI) known as the Job Scheduling Console (JSC) provides the user with the option of a dialog-based graphical interface. JSC allows a user: to create/modify scheduling objects, to create an execution plan for a batch workload, and to monitor/manage the plan when it is executing. The more experienced user can use a command line interface (CLI) for monitoring, scheduling, or troubleshooting.

An application programming interface (API) allows TWS to be integrated with any application with a scheduling facility of its own. This redbook explores that interface. Chapter 5 of the Tivoli Workload Scheduler 7.0 Reference Guide, GC32-0424 provides an overview of the TWS Extended agent API.

There are two basic aspects to job scheduling in TWS: the database and the plan. The database contains all the definitions for scheduling objects (for example, jobs, job streams, resources, and workstations). It also holds statistics about job and job stream execution, as well as information on the user ID that created an object and when an object was last modified. The plan contains all job scheduling activity planned for a one-day period. In TWS the plan is created every 24 hours and consists of all the jobs, job streams, dependencies, and other scheduling objects referenced in the upcoming day. All job streams for which you have created a run cycle are automatically scheduled and included in the plan. At the end of the day, the jobs and job streams not successfully executed can be rolled over into the next day’s plan.

© Copyright IBM Corp. 2001 1

Page 14: Implementing tws extended agent for tivoli storage manager   sg246030

1.1.1 Software configurations used for this redbookAn IBM RS/6000 43P workstation running AIX V4.3.3.0 was used in the development of this redbook. The following software was loaded onto this system:

• Tivoli Workload Scheduler V7.0

• Tivoli Management Framework V3.7

• Tivoli Job Scheduling Services V1.1

• Tivoli TWS Connector V7.0

• Tivoli Storage Manager V4.1 for AIX

1.1.2 TWS concepts and terminologyTWS uses these important concepts:

• Job streams and calendarsThe job streams created using the JSC are central to TWS’s ability to manage batch job execution. Each job stream is scheduled to run on a specific set of dates and times, and consists of a list of jobs that execute as a unit (such as the weekly backup application), along with times, priorities, and other dependencies that determine the exact order of execution.

Job streams are dated using actual dates, days of the week, or calendars. A calendar is a set of specific dates. You can create as many calendars as required to meet your scheduling needs. For example, you can define a calendar named PAYDAYS containing a list of pay dates, a calendar named MONTHEND containing a list of each last business day of the month for the current year, and a calendar named HOLIDAYS containing a list of your company’s holidays. At the start of each processing day, TWS automatically selects all the job streams that run on that day, and carries forward uncompleted job streams from the previous day.

• WorkstationsA workstation is usually an individual computer on which jobs and job streams are executed. A workstation definition is required for every computer that executes jobs in the TWS network. Workstation definitions primarily refer to physical workstations.

However, in the case of Extended agents and network agents, the workstations are logical definitions that must be hosted by a physical TWS workstation.

2 Implementing TWS Extended agent for Tivoli Storage Manager

Page 15: Implementing tws extended agent for tivoli storage manager   sg246030

There are several types of workstations in a TWS network:

• Master Domain ManagerThe Domain Manager in the topmost domain of a TWS network. It contains the centralized database files used to document scheduling objects. It creates the production plan at the start of each day, and performs all logging and reporting for the network.

• Domain ManagerA Domain Manager acts as a repeater, which allows TWS to scale to large numbers of machines. The Domain Manager forwards messages between the Master Domain Manager and the agents.

• Backup MasterA Fault-tolerant Agent (FTA) capable of temporarily assuming the responsibilities of its Domain Manager in a failover situation. This is enabled by marking the workstation as Full Status and Resolve Dependencies.

• Fault-tolerant AgentA workstation capable of resolving local dependencies and launching its jobs in the absence of a Domain Manager. The FTA is initialized at the beginning of the production day with all of the scheduling objects needed to perform the assigned workload.

• Standard agentA workstation that launches jobs only under the direction of its Domain Manager. Each job launch on the standard agent is directed in real time by the Domain Manager or Master.

• Extended agentA logical workstation definition that enables you to launch and control jobs on other systems and applications, such as PeopleSoft, Oracle Applications, SAP R/3, and MVS JES2 and JES3. Users can also write Extended agents, as presented in this redbook.

• Network agentA logical workstation definition for creating dependencies between jobs and job streams in separate TWS networks.

1.1.3 TWS architectureThe Master Domain Manager contains the centralized database files used to store scheduling objects. It creates the production plan at the start of each day, distributes the plan to the FTAs and Domain Managers in the Master Domain, and logs all transactions on the TWS network.

Chapter 1. Introduction 3

Page 16: Implementing tws extended agent for tivoli storage manager   sg246030

All communications to agents are routed through the Domain Manager, which is the management hub in a domain. The network can be managed by a mix of agents. FTAs are capable of resolving local dependencies and launching jobs should a network interruption cause them to lose communication with their Domain Managers. They can do this because each one is given a set of scheduling instructions at the beginning of every processing day.

Version 7.0 introduced a new Java GUI: the Job Scheduling Console (JSC). The JSC provides a common interface to both TWS and Operations, Planning and Control (OPC).

1.1.4 Extended agentsTWS Extended agents are programs that allow TWS to manipulate and to get information about objects in other scheduling environments. Extended agents use open scheduling APIs and protocols, and they provide an effective mechanism for extending TWS’s scheduling capabilities to foreign platforms and applications. Extended agents also allow segregation of applications at the workstation level by providing an alternative method other than jobmanrc process. This allows some applications to be treated differently using an alternative job scheduling method.

The connection between TWS and an Extended agent is shown in Figure 1. The Extended agent is installed on one of the TWS hosts. TWS accepts information from the Extended agent. The interface between TWS and an Extended agent is called the access method. The access method is a shell script or program which resides in ~TWSHOME/methods directory.

.

Figure 1. Extended agent network

4 Implementing TWS Extended agent for Tivoli Storage Manager

Page 17: Implementing tws extended agent for tivoli storage manager   sg246030

Extended agent processing is explained in Figure 2. The sequence of operations is as follows:

1. Batchman process on the FTA talks to the jobman (jobman.exe on an NT system), which is owned by the root user ID.

2. Jobman invokes JOBMAN (jobmon.exe on an NT system) process in the context of the TWS user (maestro, for example).

3. JOBMAN talks to the access method.

4. The access method invokes a Remote Function Call (RFC).

5. The access method consults with the <method.opts> file.

6. The access method talks to the system or the application’s job.

7. The access method and the job communicate with each other.

8. The method passes the information back to the TWS host through JOBMAN.

Figure 2. Extended agent processing

This explanation does not consider network communication issues. It is accepted that the Extended agent resides on a TWS server. If the Extended agent resides on an FTA, the sequence of operations for communication with the Extended agent will be the same but there will be additional processes for communication between the TWS Master and the FTA.

Note

Chapter 1. Introduction 5

Page 18: Implementing tws extended agent for tivoli storage manager   sg246030

The JOBMAN process launches the access method script to perform one of these tasks:

• Launch a job

• Manage a job

• Check for the existence of a file to satisfy an OPENS dependency

• Get the status of an external job

The syntax of the method execution is as follows:

methodname -t task options -- taskstring

where:

task: Is one of the following:

• Launch a job (LJ)

• Manage a previously launched job (MJ)

• Check availability of a file – OPENS dependency (CF)

• Get the status of an external job (GS)

options: Are the list of job properties.

taskstring: Is the string to execute from the job definition.

The following are the options (related with the job’s properties) that should be passed to the access method:

• Workstation/Host/Master

• Workstation’s node definition

• Workstation’s port definition

• The current production run number

• The job’s run number

• The job’s schedule name

• The date of the schedule (in two formats)

• The user ID (logon) for the job

• The path to the output (stdlist) file for the job

• The job ID

• The job number

• The string from the SCRIPTNAME or DOCOMMAND entry in the job definition

6 Implementing TWS Extended agent for Tivoli Storage Manager

Page 19: Implementing tws extended agent for tivoli storage manager   sg246030

An example method invocation is as follows, where job TEST is executed on the Extended agent workstation itso6 using the user ID itso and method name wgetmethod:

The current Extended agents TWS provides are:

• UNIX Remote Shell

• UNIX Local

• MVS (JES,OPC, CA7)

• SAP R/3 Batch

• PeopleSoft

• Oracle Applications

1.2 TSM overview

TSM is an end-to-end, scalable storage management solution spanning palm tops to mainframes on more than 35 platforms. Its features include:

• Centralized storage management

• Storage Area Network (SAN) features, such as LAN-free backup and tape sharing

• Automated network incremental and subfile backup, archive, and retrieval

• Fast recovery time

• Space management file migration

wgetmethod -t LJ-c ITSO6,ITSO7,ITSO7-n ITSO6-p 31111 -r 143,143 -s MACDSH91-d 20000410,955381986 -l itso-o /opt/maestro/stdlist/2000.04.10/O13676.1053-j TEST,13676 -- /home/itso//batchjobs/killer

In addition to TWS-provided Extended agents, you can always write your own Extended agents for platforms or applications thatare not TWS supported using the open API that is documented in the Tivoli Workload Scheduler 7.0 Reference Guide, GC32-0424.

Note

Chapter 1. Introduction 7

Page 20: Implementing tws extended agent for tivoli storage manager   sg246030

• High speed policy-based disaster recovery

• Data protection offered for most popular groupware, e-mail, databases, and applications

TSM is the core product of the Tivoli Storage Management product set. It provides a solution for distributed data and storage management in an enterprise network environment. It is the next generation of the product originally released by IBM as ADSTAR Distributed Storage Manager (ADSM).

The base functions TSM and its complementary products provide are:

• Data protection, including:

- Operational backup and restore of data: The backup process creates a copy of the data protect against the operational loss or destruction of file or application data. The customer defines how often to back up (frequency) and how many numbers of copies (versions) to hold.

The restore process places the backup copy of the data into a customer-designated system or workstation.

- Disaster recovery: All activities to organize, manage, and automate the recovery process from a major loss of IT infrastructure and data across the enterprise. This includes processes to move data offsite into a secure vault location, to rebuilt IT infrastructure, and to reload data successfully in an acceptable time frame.

• Storage resource management, including:

- Vital record retention, archive, and retrieval: The archive process creates a copy of a file or a set of files representing an endpoint of a process for long-term storage. Files can remain on the local storage media or can be deleted. The customer controls how long (retention period) an archive copy is to be retained.

The retrieval process locates the copies within the archival storage and places them into a costumer designated system or workstation.

- Hierarchical space management: This process provides the automatic and transparent movement of operational data from the user system disk space to a central storage repository. If the user accesses this data, it is dynamically and transparently restored to the client storage.

8 Implementing TWS Extended agent for Tivoli Storage Manager

Page 21: Implementing tws extended agent for tivoli storage manager   sg246030

1.2.1 What are the benefits of a TSM Extended agent for TWS?TSM administrators must perform several types of operations regularly each day. TSM contains a built-in scheduling facility, which provides a simple mechanism to automate routine tasks. This scheduling facility does not provide the ability to assign dependencies among scheduled tasks or to assign limits or priorities. By extending TWS to schedule these tasks, you can take advantage of its advanced scheduling capabilities.

The following common TSM tasks were implemented for this example:

• Database backup (BACKUP DB)

• Volume history backup (BACKUP VOLHISTORY)

• Device configuration backup (BACKUP DEVCONFIG)

• Delete volume history (DELETE VOLHISTORY)

• Inventory expiration (EXPIRE INVENTORY)

• Client backup

All TSM tasks executed by the TSM Extended agent (tsmxagent), use the TSM Administrative Client Interface (dsmadmc). The user ID used to log in to the dsmadmc interface is fetched from the tsmAdmin variable in the tsmxagent.opts file in the TWS methods directory. The password is retrieved from the TWS parameter object named TSMPASS.

Client backups are performed as follows:

• A schedule is defined to run a backup immediately (DEFINE SCHEDULE).

• The schedule is associated with the client specified (DEFINE ASSOCIATION).

• The schedule is monitored until completion or timeout (QUERY EVENT).

• The schedule is deleted (DELETE SCHEDULE).

• The status is reported to TWS.

As shown in Figure 3 on page 10, Extended agents are used to extend the job scheduling functions of TWS to other systems and applications.

Chapter 1. Introduction 9

Page 22: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 3. Extended agent

An Extended agent is defined as a workstation that has a host and an access method. The host is any other workstation, except another Extended agent. The access method is a Tivoli-supplied or user-supplied script or program that the host executes whenever the Extended agent is referenced in the production plan. For example, to launch a job on an Extended agent, the host executes the access method, passing it job details as command line options. The access method communicates with the external system or application to launch the job and return the status of the job.

Each Extended agent must have a logical workstation definition. This logical workstation must be hosted by a TWS physical workstation, either a Master, Domain Manager, or FTA workstation. The Extended agent workstation definition references the name of the access method and the host workstation. When jobs are launched on the Extended agent workstation, the access method is called and passes the job information to the external system. For an example of defining an Extended agent workstation, see the Tivoli Workload Scheduler 7.0 User’s Guide, GC32-0423.

1.3 Summary

TWS is a multiplatform distributed scheduling program that provides high-volume, complex scheduling capability for many systems and applications. Master Domain Manager, Domain Manager, Backup Master, Fault-tolerant Agent and standard agent are various types of workstations in a TWS network.

You can extend the number of platforms and applications TWS supports by writing TWS Extended agents which allow TWS to manipulate and to get information about objects in other scheduling environments.

Host

TWS network

Extended agent Externalsystem orapplication

10 Implementing TWS Extended agent for Tivoli Storage Manager

Page 23: Implementing tws extended agent for tivoli storage manager   sg246030

TSM is a scalable storage management solution spanning palm tops to mainframes on more than 35 platforms. Centralized storage management, LAN-free backup and tape sharing, and automated network incremental and subfile backup, archive, and retrieval are some of the important functions that TSM provides.

Chapter 1. Introduction 11

Page 24: Implementing tws extended agent for tivoli storage manager   sg246030

12 Implementing TWS Extended agent for Tivoli Storage Manager

Page 25: Implementing tws extended agent for tivoli storage manager   sg246030

Chapter 2. Extended agent functions

This chapter describes the functions of the Tivoli Workload Scheduler (TWS) Extended agent method, the access method interface and the communications protocols between jobs running within an access method.

2.1 Introduction

The Extended agent is defined as a workstation that has a host and an access method. The host is any other TWS workstation, except another Extended agent. The access method is a Tivoli-supplied or user-supplied script or program that the host executes whenever the Extended agent is referenced in the production plan.

For example, to launch a job on an Extended agent, the host executes the access method, passing it job details as command line options. The access method communicates with the external system or application to launch the job and return the status of the job.

2.2 Workstation definition

Each Extended agent must have a logical workstation definition. This logical workstation must be hosted by a TWS physical workstation, either a Master, Domain Manager, or FTA workstation. The Extended agent workstation definition references the name of the access method and the host workstation. Workstation definitions are created using the command line interface, Composer, or Job Scheduling Console (JSC). When jobs are launched on the Extended agent workstation, the access method is called and passes the job information to the external system.

Suppose, for the purpose of illustration, that you have a TWS network comprised of three workstations: a Master workstation (called Copernicus), a Fault-tolerant Agent (FTA) workstation (Kepler), and an Extended agent workstation (Galileo). The following is an example of the Extended agent workstation definition:

CPUNAME galileoOS OTHERNODE focusTCPADDR 1609FOR MAESTRO

HOST keplerACCESS nuncius

© Copyright IBM Corp. 2001 13

Page 26: Implementing tws extended agent for tivoli storage manager   sg246030

END

In this case, Galileo is the name of the Extended agent workstation, focus is the node name, 1609 is the TCP address, Kepler is the host, and nuncius is the name of the access method. An executable file (script or program) named nuncius must reside in the /methods subdirectory of the TWS installation. For Extended agents only, the node and tcpaddr definitions are left to the method developer to define. In other words, depending on the nature of the access method, node might have different uses.

2.3 Method options file

By default, when executing an Extended agent job, TWS tries to execute the method file as the logon defined for each job to be run by the method. When executing the method script to check for an OPENS dependency (using the check file [CF] task) TWS executes the method as root by default. You can change this behavior by using a method options file to specify special login information and other options for your access method. For example, you may wish to use the logon field of your agent’s job definitions to represent a logon to a foreign system that does not exist on the Extended agent’s host.

TWS reads the file, if it exists, before executing a method. If the file is modified after TWS is started, the changes take effect when it is stopped and restarted. The file can contain TWS options and any other method information you wish to include. The options recognized by TWS are:

LJuser=usernameCFuser=username

where:

LJuser=username: Specifies the login to use for the launch job (LJ) and manage job (MJ) tasks. The default is the login from the job definition.

CFuser=username: Specifies the login to use for the CF task. The default is root for UNIX, and for Windows NT it is the user name of the account in which TWS was installed.

14 Implementing TWS Extended agent for Tivoli Storage Manager

Page 27: Implementing tws extended agent for tivoli storage manager   sg246030

2.4 Access method interface

The interface between TWS and an access method consists of information passed to the method on the command line, and messages returned to TWS in stdout.

2.4.1 Method command line syntaxThe TWS host runs an access method using the following command line syntax:

methodname -t task options -- taskstring

where:

methodname: Specifies the file name of the access method. In our example, this is nuncius. All access methods must be stored in the WShome/methods directory.

-t task: Specifies the task to be performed, where task is one of the options listed in Table 1 on page 16:

If the Extended agent’s host is a Windows NT computer, these users must be defined as TWS user objects. The options file must have the same path name as its access method, with an .opts file extension. For example, the Windows NT path name of an options file for a method named nuncius is WShome\methods\nuncius.opts.

Note

Chapter 2. Extended agent functions 15

Page 28: Implementing tws extended agent for tivoli storage manager   sg246030

Table 1. Task types

options: Specifies the options associated with the task. See Section 2.4.2, “Task options” on page 16 for more information.

taskstring: A string of up to 255 characters associated with the task. See Section 2.4.2, “Task options” on page 16 for more information.

2.4.2 Task optionsThe task options are listed in Table 2. An “x” means the option is valid for the task.

Table 2. Task options

Task Description

LJ Launches a job. The access method is called with this task option when TWS launches a job. TWS will expect the access method to continue running until the job it executes is complete.

MJ Manages a previously launched job. Use this option to synchronize job(s) if a prior LJ task terminated unexpectedly. The MJ method is called for under only a few circumstances. For example, TWS or its batchman process terminates (an operator issues a Conman STOP command to the agent’s host) while an Extended agent job is running. When the TWS processing is restarted, it will execute the Extended agent’s access method for each job that was previously running, passing it the MJ task and the same arguments initially sent to the job. The access method should use the MJ task to determine the state of the previously running job and report that state back to TWS.

CF Checks the availability of a file. Use this option to check file OPENS dependencies. Using the Galileo workstation example, if a schedule contained the dependency (OPENS GALILEO#/this/is/my/file) TWS would call the access method for Galileo and pass it the CF task and the path (/this/is/my/file).

Task Options Task string

-t -c -n -p -r -s -d -l -o -j -q

LJ x x x x x x x x x ljstring

MJ x x x x x x x x x mjstring

CF x x x x cfstring

16 Implementing TWS Extended agent for Tivoli Storage Manager

Page 29: Implementing tws extended agent for tivoli storage manager   sg246030

-c xagent,host,master: Specifies the TWS names of the Extended agent, the host, and the Master Domain Manager, separated by commas.

-n nodename: Specifies the node name of the computer associated with the Extended agent, if any. This is defined in the Extended agent’s workstation definition node field.

-p portnumber: Specifies the TCP port number associated with the Extended agent, if any. This is defined in the Extended agent’s workstation definition TCP Address field.

-r currentrun,specificrun: Specifies the current run number of TWS and the specific run number associated with the job, separated by a comma. The current and specific run numbers might be different if the job is carried forward from an earlier run.

-s jstream: Specifies the name of the job’s job stream.

-d scheddate,epoch: Specifies the schedule date (yymmdd) and the epoch equivalent, separated by a comma.

-l user: Specifies the job’s user name. This is defined in the job definition Logon field.

-o stdlist: Specifies the full path name of the job’s standard list file. Any output from the job must be written to this file.

-j jobname,id: Specifies the job’s name and the unique identifier assigned by TWS, separated by a comma. The name is defined in the job definition Job Name field.

-q qualifier: Specifies the qualifier to be used in a test command issued by the method against the file.

-- ljstring: Used with the LJ task. The string from the script file or command field of the job definition.

Chapter 2. Extended agent functions 17

Page 30: Implementing tws extended agent for tivoli storage manager   sg246030

-- mjstring: Used with the MJ task. The information provided to TWS by the method in a %CJ response to an LJ task. Usually, this identifies the job that was launched. For example, a UNIX method can provide the process identification (PID) of the job it launched, which TWS sends as part of an MJ task.

-- cfstring: Used with the CF task. For a file OPENS dependency, the string from the Opens Files field of the job stream definition.

2.4.3 ExampleUsing our previous workstation definition and the options previously listed, here is an example of how your access method would be called from TWS. In this example, a job defined as tsmjob1 runs the command ADMIN VHBACKUP

/opt/tsm/dat/fa20001020 in the job stream (schedule) DAILYBAK:

/opt/maestro/methods/nuncius -t LJ -c GALILEO,KEPLER,COPERNICUS -n focus -p1609 -r 109,109 -s DAILYBAK -d 20001207,976147200 -l root -o/opt/maestro/stdlist/2000.12.07/O9041.1414 -j TSMJOB1,9041-- ADMIN VHBACKUP/opt/tsm/dat/fa20001020

Let us examine the command structure from the example.

/opt/maestro/methods/nuncius

This is the directory to the access method script.

-t LJ

The task option LJ was sent, indicating that a job is being run.

-c GALILEO,KEPLER,COPERNICUS

This option shows that Galileo is the Extended agent’s name, Kepler is the agent’s host’s name, and Copernicus is the TWS Master’s name.

-n focus

Focus is the node name of the Extended agent. This name comes directly from the workstation definition for Galileo.

18 Implementing TWS Extended agent for Tivoli Storage Manager

Page 31: Implementing tws extended agent for tivoli storage manager   sg246030

-p 1609

The number 1609 is the tcpaddr port definition from the workstation definition for Galileo.

-r 109,109

The current run number (TWS production day) is 109, as is the job’s run number. If, for example this option was “-r 110,109”, it would signify that the job stream (schedule) from which this job is running has been carried forward from a previous day.

-s DAILYBAK

The job stream (schedule) name from which this job is running is DAILYBAK.

-d 20001207,976147200

The current scheduling production run date is December 7, 2000. Remember that the scheduling production run date may be different than the actual calendar run date.

-l root

The job run by this method should log on to the system as root. This information comes from the job definition.

-o /opt/maestro/stdlist/2000.12.07/O9041.1414

All output (stdout and stderr) is being redirected to the file /opt/maestro/stdlist/2000.12.07/O9041.1414 on the host workstation.

-j TSMJOB1,9041

The name of the job being run is TSMJOB1, and its job number (as seen in the Conman SHOWJOBS command) is 9041. On UNIX systems only, 9041 is also the parent process ID for this job.

-- ADMIN VHBACKUP /opt/tsm/dat/fa20001020

The rest of the arguments after a double-hyphen are directly from the SCRIPTNAME or DOCOMMAND entry in the TWS job definition. In this case, the application understands the command ADMIN VHBACKUP and processes the command appropriately. Typically the access method ignores any options after the double hyphen and passes them directly to the target application. This is, of course, up to the method’s author to determine.

Chapter 2. Extended agent functions 19

Page 32: Implementing tws extended agent for tivoli storage manager   sg246030

Upon execution of this job, its status would be shown in the Console Manager as:

2.5 Method response messages

Methods returns information to TWS in messages written to stdout. Each line starting with a percent sign (%) and ending with a new line is interpreted as a message. The messages have the following format:

%CJ state [mjstring]%JS [cputime]%UT [errormessage]

where:

CJ: Changes the job state.

state: The state to which the job is changed. All TWS job states are valid except hold and ready.

mjstring: A string of up to 255 characters that TWS will include in any MJ task associated with the job.

JS [cputime]: Indicates successful completion of a job and provides its elapsed run time in seconds. This message must be presented (usually with an echo statement) before the method ends in order for the job to be considered successful.

UT [errormessage]: Indicates that the requested task is not supported by the method. Displays a string of up to 255 characters that TWS will include in its error message (stored in the TWS standard list file; typically this file is ~maestro/stdlist/yyyy.mm.dd/MAESTRO).

You can use these messages within your access method to relay information to the TWS Console Manager. By changing the status of your job, operators can pay special attention to your jobs by filtering their console windows by job status. For example, you might have jobs toggle between wait and exec

Est) (Est)CPU Schedule Job State Pr Start Elapse Dependencies

GALILEO #DAILYBAK ******** SUCC 10 14:14 01:10TSMJOB1 SUCC 10 14:14 01:10 #J9041

%

20 Implementing TWS Extended agent for Tivoli Storage Manager

Page 33: Implementing tws extended agent for tivoli storage manager   sg246030

states by issuing an echo %CJ WAIT or echo %CJ EXEC while the job connects to the application and executes its function.

2.6 Execution and troubleshooting

The Extended agent’s access method is executed by TWS’s jobman process, much as a standard job is launched through jobmanrc.

2.6.1 Executing the methodBefore the method is launched, TWS establishes an execution environment for the method:

• The LJuser parameter is read from the method options file to determine the user account with which to run the method. If the parameter is not present or the options file does not exist, the user account specified in the Logon field of the job’s definition is used. In addition, the following environment variables are set:

- HOME: User’s home directory

- LOGNAME: Login user’s name (from the job definition)

- PATH: For UNIX, /bin:/usr/bin; for Windows, %SYSTEM%\SYSTEM32

- TZ: Time zone

2.6.2 Killing a jobWhile an access method is running an MJ or LJ task, it should trap a SIGTERM signal (signal 15). This is the signal sent to the job when an operator issues a kill command from the user interface. When a kill signal is caught, the method should attempt to stop or kill the job and exit without writing a %JS message.

2.6.3 Method troubleshootingIf the method cannot be executed, its state is set to fail. All output messages from an access method, except those that start with a percent sign (%), are written to the job’s standard list (stdlist) file. For GS and CF tasks that are not associated with TWS jobs, messages are written to TWS’s standard list file. For information regarding a problem of any kind, check these files.

For Extended agents, error, warning, and information messages are written to TWS’s stdlist file.

Chapter 2. Extended agent functions 21

Page 34: Implementing tws extended agent for tivoli storage manager   sg246030

• A successful job launch generates the following message:

Launched job jobname for wkstation ,#J jobid for user username .

• Failure to launch a job generates the following message:

Error launching jobname for wkstation :errortext

• Failure of a CF task generates the following message:

Error invoking methodname for wkstation :errortext

• Failure of an MJ task generates the following message:

Error managing jobname for wkstation using methodname :errortext

• When a method sends a message to Jobman that is not recognized, the following message is generated:

Error:message invalid for jobname ,#j jobnumber for wkstation using

methodname ."first 64 characters of the offending message "

2.7 Summary

In this chapter we covered the functions of the TWS Extended agent method, the Access Method Interface and the communications protocols between jobs running within an access method.

The main functions used in an Extended agent method are:

• LJ: Launch job

• MJ: Manage job

• CF: Check file dependency

The Extended agent’s access method is executed by the jobman process, much as a standard job is launched through jobmanrc.

22 Implementing TWS Extended agent for Tivoli Storage Manager

Page 35: Implementing tws extended agent for tivoli storage manager   sg246030

Chapter 3. Case study - TSM Extended agent

This chapter describes scripts that will be useful to Tivoli Workload Scheduler(TWS) and Tivoli Storage Manager (TSM) administrators.

These scripts are about TSM processes such as backup, storage pools,migration, reclamation, volume history, and device configuration. Because, inpractice, TSM administrators generally schedule these process, it makessense to write a TSM Extended agent for TWS that incorporates thesefunctions. Using the TSM Extended agent, administrators can schedule theseTSM operations through TWS.

First, here is some background information about these operations. Thefollowing sections should be especially useful if you are not familiar with TSMscheduling operations.

• Backup database: Use this command to back up a TSM database tosequential access volumes (Figure 4 on page 24). To determine how muchadditional storage space a backup will require, use the QUERY DB command.This command displays the database pages (in megabytes) that havechanged since the last backup.

The syntax of the command is:

where:

backupdb: Is the name of the devclass defined on the TSM server.

type=full: Specifies that you can run the full backup on the TSMdatabase. This parameter is optional. Possible optionsare: incremental, full and dbsnapshot. The default isincremental.

scratch=yes: To take the device that is scratch. The default value is yes.This parameter is optional. If you put scratch=no, then itwill specify that scratch volume cannot be used.

wait: Specifies whether to wait for the server to completeprocessing this command in the foreground. The default isno. Possible options are: yes (the server processes thecommand in foreground), and no (the server processes thecommand in background).

You can find more details about the syntax of the commands in the TivoliStorage Manager for AIX Administrator’s Reference, GC35-0404.

backup db devclass=dbbackup type=full sctatch=yes wait=yes

© Copyright IBM Corp. 2001 23

Page 36: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 4. Requesting a backup

If a backup completes unsuccessfully, you can verify and restart it. Forexample, in Figure 5 on page 25 the backup was unsuccessful for some filesand restarted.

Backup process

TSM serverUser

Requests abackup

Library

24 Implementing TWS Extended agent for Tivoli Storage Manager

Page 37: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 5. Verifying that a backup was unsuccessful

• Backup storage pool: Use this command to back up primary storage poolfiles to a copy storage pool. The operation is shown in Figure 6 onpage 26.

If a file already exists in the copy storage pool, the file is not backed upunless the copy is marked as damaged. However, a new copy is notcreated if the file in the primary storage pool is also marked as damaged.In a random-access storage pool, neither cached copies of migrated filesnor damaged files are backed up.

If migration for a storage pool starts during a storage pool backup, somefiles may be migrated before they are backed up. You may want to back upstorage pools that are higher in the migration hierarchy before backing upstorage pools that are lower. For example, when performing a storagepool backup to copy the contents of a storage pool offsite, if the process isnot done according to the existing storage pool hierarchy, some files may

Check .NSF files

danes.nsf

desinha.nsf

mcelo.nsf

luisv.nsf

vasfi.nsf

Library

AdminstrationServer

danes.nsf

desinha.nsfdesinha.nsf

mcelo.nsf

luisv.nsf

vasfi.nsf

mcelo.nsf

vasfi.nsf

Backup

Chapter 3. Case study - TSM Extended agent 25

Page 38: Implementing tws extended agent for tivoli storage manager   sg246030

not be copied to the copy storage pool. This could be critical for disasterrecovery purposes. When performing a storage pool backup on multiplestorage pools, the primary storage pool should be completed before thebackup process on the next storage pool.

The syntax of the command is as follows:

where:

spacemgtpool: Is the primary backup that you want to back up.

copypool: Is the copy storage pool defined on TSM server.

Figure 6. Backing up a storage pool

• Reclamation: Specifies when the server reclaims a volume, based on thepercentage of reclaimable space on a volume (Figure 7 on page 27).Reclamation makes the fragmented space on volumes usable again bymoving any remaining active files from one volume to another volume,thus making the original volume available for reuse. You can specify aninteger from one to 100. The value 100 means that reclamation is notperformed.

If you change the value from the default of 100, specify a value of 50percent or greater so that files stored on two volumes can be combinedinto a single output volume.

To move data from the reclaim storage pool back to the original storagepool, use the storage pool hierarchy. Specify the original storage pool asthe next storage pool for the reclaim storage pool.

The syntax of the command is as follows:

backup stgpool spacemgtpool copypool

update stgpool copypool reclaim=50

26 Implementing TWS Extended agent for Tivoli Storage Manager

Page 39: Implementing tws extended agent for tivoli storage manager   sg246030

where:

reclaim: Is the percentage of the reclamation in copypool.

Figure 7. Reclamation in the tape device

• Migration: You can use a primary storage pool as the destination forbackup files, archive files, or files migrated from client nodes.

The following command is used for this purpose:

where:

somepool: Is the pool name defined on the TSM server.

dbbackup: Is the device class name defined on the TSM server.

pooltype: Specifies that you want to define a primary storage pool.The default value is primary.

define stgpool somepool dbbackup pooltype=primary access=readwrite maxsize=nolimthighmigh=90 lowmig=70 migprocess=1 collocate=no migcontinue=yes reusedelay=0migdelay=0

Chapter 3. Case study - TSM Extended agent 27

Page 40: Implementing tws extended agent for tivoli storage manager   sg246030

access: Specifies how client nodes and server processes (such asmigration and reclamation) can access files in the storagepool. The default value is readwrite, but you can alsodefine as readonly and unavailable.

maxsize: Specifies the maximum size for a physical file size that theserver can store in the storage pool during a session witha client. The default value is nolimit.

highmig: Specifies that the server starts migration for this storagepool when the amount of data in the pool reaches thispercentage of the pool’s estimated capacity. You canspecify an integer from zero to 100. The default value is90. When the storage pool exceeds the high migrationthreshold, the server can start migration of files by node,to the next storage pool, as defined with theNEXTSTGPOOL parameter. You can specify highmig=100

to prevent migration for this storage pool.

lowmig: Specifies that the server stops migration for this storagepool when the amount of data in the pool reaches thispercentage of the pool’s estimated capacity. You canspecify an integer from zero to 99. The default value is 70.When the storage pool reaches the low migrationthreshold, the server does not start migration of anothernode’s files. Because all file spaces that belong to a nodeare migrated together, the occupancy of the storage poolcan fall below the value you specified for this parameter.You can set lowmig=0 to permit migration to empty thestorage pool.

migprocess: Specifies the number of processes the server uses formigrating files from this storage pool. You can specify aninteger from one to 999. The default value is one. Duringthe migration the server runs this number of processes inparallel to provide the potential for improved migrationrates.

migdelay: Specifies the minimum number of days a file must remainin a storage pool before the file becomes eligible formigration from the storage pool. The server counts thenumber of days from the day the file was stored in thestorage pool or retrieved by a client, whichever is morerecent. The default is zero, which means you do not wantto delay migration.

28 Implementing TWS Extended agent for Tivoli Storage Manager

Page 41: Implementing tws extended agent for tivoli storage manager   sg246030

migcontinue: Specifies whether you allow the server to migrate files thatdo not satisfy the migration delay time. The default valueis yes. Because you can require that files remain in thestorage pool for a minimum number of days, the servermay migrate all eligible files to the next storage pool yetnot meet the low migration threshold. This parameterallows you to specify whether the server is allowed tocontinue the migration process by migrating the files thatdo not satisfy the migration delay time.

Figure 8 shows the migration process.

Figure 8. Migration process

• Backup device configuration: Use this command to back up thefollowing information in one or more files:

- Device class definitions

- Library definitions

Migration process

Client ClientTSM server

Disk

Library

Backup

Disk

Chapter 3. Case study - TSM Extended agent 29

Page 42: Implementing tws extended agent for tivoli storage manager   sg246030

- Drive definitions

To restore the TSM database, the device configurations must be available.You can use the devconfig server option to specify one or more files inwhich to store device configuration information. TSM updates the fileswhenever a device class, library, or drive is defined, updated, or deleted(Figure 9).

The syntax of the command is as follows:

where:

device: Is the directory that it will back up the information aboutdevconfig.

Figure 9. Device configuration

• Backup volume history: Use this command to back up sequentialvolume history information to one or more files. You can use volumehistory information when you reload the database and audit affectedstorage pool volumes. If you cannot start the server, you can use thevolume history file to query the database about these volumes. Thevolume history includes information about the following types of volumes:

- Database backup volumes

- Database dump volumes

- Export volumes

backup devconfig filenames=device

Device class definitions

Library definitions

Drive definitions

Devices

30 Implementing TWS Extended agent for Tivoli Storage Manager

Page 43: Implementing tws extended agent for tivoli storage manager   sg246030

- The following sequential access storage pool volumes:

• Volumes added to storage pools

• Volumes reused through reclamation or move-data operations

• Volumes removed by using the delete volume command or duringreclamation of scratch volumes

The syntax of the command is:

where:

volhist: Is the name of the filename that will contain information aboutthe volhistory backup.

• Delete volume history: Use this command to delete volume history filerecords that are no longer needed (for example, records for obsoletedatabase backup volumes).

When you delete records for volumes that are not in storage pools (forexample, database backup or export volumes), the volumes return toSource Manager, which acquires them as scratch volumes. Scratchvolumes of device-type files are deleted. When you delete the records forstorage pools volumes remain in the TSM database. When you deleterecords for recovery-plan file objects from a source server, the objects onthe target server are marked for deletion.

The syntax of the command is as follows:

where:

type: Specifies the type of records, which also meet the date andtheir criteria, to delete from the volume history file. Rpfilespecifies to delete only records that contain information aboutfull and incremental database backup volumes and recoveryplan file volumes.

todate: Specifies the date to use to select sequential volume historyinformation to be deleted. TSM deletes only those recordswith a date on or before the date you specify.

For more details, you can see the Tivoli Storage Manager for AIXAdministrator’s Reference, GC35-0404.

backup volhistory filenames=volhist

delete volhistory type=rpfile todate=11/31/00

Chapter 3. Case study - TSM Extended agent 31

Page 44: Implementing tws extended agent for tivoli storage manager   sg246030

• Expire inventory: Use this command to manually start inventoryexpiration processing. This inventory expiration process removes theclient backup and archive file copies from server storage based on thepolicy specified in the backup and archive copy groups of themanagement classes to which the files are bound. The inventoryexpiration process that runs during server initialization does not removethese virtual volumes.

Only one expiration process is allowed at any time. If an expirationprocess is currently running you can not start another process.

The syntax of the command is as follows:

where:

quiet: Specifies whether the server suppresses detailed messagesabout the policy changes during the expiration processing.This parameter is optional. The default value is no, whichspecifies that the server sends detailed informationalmessages. You can also put the value yes, which specifiesthat the server sends only summary messages.

wait: Specifies whether to wait for the server to completeprocessing this command in the foreground. This parameter isoptional. Possible values are no, which specifies that theserver processes this command in the background, and yes,which specifies that the server processes this command in theforeground.

skipdirs: Specifies whether the server skips directory type during theexpiration processing. Possible values are: no, which specifiesthat the server will expire files and directories based upon theappropriate policy criteria, and yes, which specifies that theserver will skip directory type objects during expirationprocessing even if the directories are eligible for expiration.

duration: Specifies the maximum number of minutes for the expirationprocess to run. The process stops when the specified numberof minutes have passed or when all eligible expired objectsare deleted, whichever comes first. You can specify a numberfrom one to 999,999 (optional).

• Restore database: To restore a database or volume to its most currentstate, the log mode must have been set to roll-forward continuously fromthe time that the last backup series was created.

expire inventory quiet=no wait=no skipdirs=no duration=40

32 Implementing TWS Extended agent for Tivoli Storage Manager

Page 45: Implementing tws extended agent for tivoli storage manager   sg246030

If the log mode is set to roll-forward after a point-in-time databaserestoration, a database backup starts when the server is brought up for thefirst time. This can cause loss of data: A tape can have current data on it,but because of the point-in-time restoration, it can be marked as scratch.When the server starts for the first time, TSM may use this tape to writethe database backup, thus destroying the original data on this tape.

You can restore a database if the following are true:

- The log mode was set to roll-forward continuously from the time the lastbackup series was created.

- An intact recovery log is available.

- An intact volume history file is available.

TSM requests volume mounts to load the most recent backup series andthen uses the recovery log to update the databases to its most currentstate.

If the volume history file is unavailable, you can use one or more dsmc

restore db commands to restore the database to a specific point in time.For example, to load a full backup and one or more incremental backups,issue a dsmc restore db command for the full backup and an additionaldsmc restore db command for each incremental backup. When you usemultiple dsmc restore db commands, specify commit=no for each commandexcept the last one. For the last command, specify commit=yes. Thedatabase remains in an inconsistent and unusable state until you issue adsmc restore db command with a commit=yes.

The syntax of the command is as follows:

where:

devclass: Specifies the name of the sequential access device class touse. The device class must be defined in a deviceconfiguration file.

volumename: Specifies the backup volume to use to restore the database.Possible values are:

volume_name: Specifies the names of the volumes. Tospecify multiple volumes, separate the nameswith commas without intervening spaces.

file:file_name: Specifies the name of a file that contains a listof the volumes.

dsmc restore db devclass=device_class_name volumename=volume_name commit=no

Chapter 3. Case study - TSM Extended agent 33

Page 46: Implementing tws extended agent for tivoli storage manager   sg246030

commit: Specifies whether this is the last restore command needed torestore the database. This parameter is optional. The defaultvalue is no (specifies that you will issue one or more additionaldsmc restore db commands), but you can also define the valueyes (specifies that this is the last restore command to restorethe database).

After you analyze all the scripts, you can also test the environment andcommands in the TWS structure.

Initially install the TWS software on your system. Decide on which systemyour Master will be (this is the system on which the TWS database resides,as well as the system on which all updates are received). Please follow theinstallation steps in the Tivoli Workload Scheduler 7.0 Planning andInstallation Guide, GC32-0422. Once the software is installed correctly, makesure your display and path are setup as well.

To access the TWS database, execute the gmaestro command (which shouldbe located in the TWShome/bin directory). Make sure you are logged on withthe user maestro (default TWS user), or the name of the maestro user youhave chosen. Gmaestro contains the Composer screen and the Conmanscreen. Further details on their functionality is explained in the document.

Figure 10 shows the Maestro Main Window the gmaestro command launched.

Figure 10. Maestro (TWS) Main Window

34 Implementing TWS Extended agent for Tivoli Storage Manager

Page 47: Implementing tws extended agent for tivoli storage manager   sg246030

You can choose the Database Manager (Composer), which will allow you toenter the CPU, CPU classes, domains, calendars, jobs, and users, orConsole Manager (Conman), which displays information about schedules,jobs, CPUs, and parameters.

Composer can be accessed from the Master only or wherever the mozartdirectory is accessible. We do not recommend that the mozart directory ismounted or mapped as the TWS database should not be accessible to allusers. Composer reads the mozart directory and the corresponding filepertaining to your choice. At this point you can add, modify, copy, and deletedata. Make sure you have the proper security access when performing suchoperations.

Conman displays job status, allows for ad hoc submission, and allows you todisplay previous production days and their status. Again, all features may beperformed if the proper access is given.

When you click the Composer button, a window (Figure 11) will appear:

Figure 11. Maestro (TWS) Composer window

You can display, add, and modify information about CPU, CPU classes,domains, and users by clicking the corresponding button.

If you choose the Jobs button, you may use the filter feature to list all jobsaccording to the chosen CPU or you can display all jobs in the TWS

Chapter 3. Case study - TSM Extended agent 35

Page 48: Implementing tws extended agent for tivoli storage manager   sg246030

database. Clicking the Jobs button, you will see a list of jobs, as seen inFigure 12 on page 36.

Figure 12. List of jobs scheduled on your server

You can execute modifications, additions, deletions, and/or replication (SaveAs choice) on an existing job. To do that, right-click the desired job, andselect Modify. The following window (Figure 13 on page 37) will appear.Follow the instructions to make your changes or just display the job.

36 Implementing TWS Extended agent for Tivoli Storage Manager

Page 49: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 13. Changing job definitions

As illustrated, adding a new job should be relatively easy. However, a fewexplanations are needed in order for you to take full advantage of TWS.

With TSM and TWS, you can take advantage of several options to ensureyour TSM jobs are successful. The Recovery Options, for instance can beused to ensure that a backup is successfully executed every time. Bychoosing the Continue option or Rerun option, the Recovery Job and/orRecovery Prompt can be used to ensure backups are always successful. Youcan key in the recovery job, which may be, for example, another set of tapesto back up to if the primary tapes are not available or a differentdirectory/system if a file system full occurs. Whichever you chose, a backupshould always be successful. Also, you can use the Recovery Prompt as amessaging vehicle to the operations staff on the proper execution of therecovery job.

The Interactive option is for NT systems within your TWS environment. Thisoption is used if the scheduled job requires manual intervention.

In Conman (Console Manager), you can display various information as wellas submit ad hoc jobs and schedules. The information is retrieved from theSymphony file located in the maestrohome directory.

When you click this button, a window (Figure 14 on page 38) will appear:

Chapter 3. Case study - TSM Extended agent 37

Page 50: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 14. Maestro (TWS) Console Manager

By double-clicking the buttons, the corresponding information is displayed, assummarized here:

• CPUs: Status on each TWS system is displayed. The information on itsconnectivity with the Master, the run number, and the node name aredisplayed. The exact information can be accessed from the command lineinterface through the command conman -v.

• Domains: Displays the Master Domain, the associated Domain Manager,and its parent.

• Schedules: Displays all schedules along with their status, priority, starttimes, and dependencies

• Jobs: Displays all jobs along with their status, priority, start times, anddependencies.

• Resources: Displays resources and their associated CPUs. Resourcescan be used when two or more jobs require the use of the same resource,for example a set of tapes (the tape is the resource). Once one job isfinished utilizing the one set of tapes or a resource, TWS releases theresource and then next job commences.

• Prompts: Displays the prompt’s description, and its associated CPU,schedule, and job.

38 Implementing TWS Extended agent for Tivoli Storage Manager

Page 51: Implementing tws extended agent for tivoli storage manager   sg246030

• Files: Displays the files with their associated CPUs, schedules, and jobs.

All of these features can be used to compliment any Tivoli product, especiallyTSM. Each feature will be discussed in more detail in Chapter 4, “Samplescenarios” on page 43.

Figure 15 shows you the scheduled jobs.

Figure 15. Jobs scheduled on TWS

You can see the status of the scheduled job by right-clicking. This shows youwhether the job was successful, or abended or failed. Also the screen canshow you if the job and/or schedule is ready and when it will start, accordingto start time or dependency columns, which can include resources, files, orother jobs and/or schedules.

If a job fails or abends, you can see the reason why it was unsuccessful byright-clicking on the job (Figure 16 on page 40).

Chapter 3. Case study - TSM Extended agent 39

Page 52: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 16. Right-click to see the status of the job

The Stdlist option allows you to read the log (located in themaestrohome/stdlist/MM.DD.YYYY directory) associated with that job. Forfurther explanation on various other options, please refer to the TivoliWorkload Scheduler 7.0 User's Guide, GC32-0423. Figure 17 shows asample stdlist output.

Figure 17. Status of the job

40 Implementing TWS Extended agent for Tivoli Storage Manager

Page 53: Implementing tws extended agent for tivoli storage manager   sg246030

The stdlist header contains the job name, and associated schedule and CPUnames, as well as the login name and the script location. As also shown, itdisplays the process ID, and the date and time of the job execution.

The body of the stdlist contains the steps executed for the job to becamesuccessful or unsuccessful. The information contained depends solely on itsscript and the information to standard out (stdout). You can also print thisoutput.

3.1 Summary

In this chapter we described the following TSM functions that can bescheduled with the TWS:

• Backup database: To backup a TSM database to sequential accessvolumes.

• Backup storage pool: To backup primary storage pool files to a copystorage pool.

• Reclamation: To reclaim a volume, based on the percentage ofreclaimable space on a volume.

• Migration: To copy files to a library when a threshold is reached on thedisk.

• Backup device configuration: To backup the device class, library anddrive definitions.

• Backup volume history: To backup sequential volume history informationto one or more files.

• Expire inventory: To manually start inventory expiration processing.

• Restore database: To restore a database or volume to its most currentstate.

The information in this chapter will be especially useful if you are not familiarwith TSM scheduling operations.

Chapter 3. Case study - TSM Extended agent 41

Page 54: Implementing tws extended agent for tivoli storage manager   sg246030

42 Implementing TWS Extended agent for Tivoli Storage Manager

Page 55: Implementing tws extended agent for tivoli storage manager   sg246030

Chapter 4. Sample scenarios

This chapter will address several scenarios when utilizing Tivoli WorkloadScheduler (TWS) with Tivoli Storage Manager (TSM) product sets.

This chapter will demonstrate how to schedule TSM functions within TWS.Primarily we will create jobs and schedules in TWS to handle such functions.We will address dependency options and display jobs/schedules output.

4.1 Description of the scenarios

The scenarios described involve information about backup databases,backup storage pools, migration, and various other typical scenarios.

4.1.1 Database backupOur first scenario is database backup. You can specify the type of backup thatyour company requires. This depends on the necessary data’s level ofavailability for recovery purposes, as well as addressing service levelagreements (SLAs) between your company and third party vendors.

We will start with scheduling a TSM function in TWS:

1. Execute the TWS interface and choose Composer from the main menu(Figure 18 on page 44).

In these scenarios we used the legacy TWS user interface (Composer andConman) instead of the new Job Scheduling Console (JSC), which wasavailable with the TWS V7.0. The TWS Extended agent for the TSM codewe introduce in this redbook is valid for TWS V7.0, and for TWS versionsprior to 7.0, in which JSC is not supported.

Note

© Copyright IBM Corp. 2001 43

Page 56: Implementing tws extended agent for tivoli storage manager   sg246030

.

Figure 18. Maestro (TWS) Main Window

2. From the Scheduling Objects selections, choose Jobs (Figure 19 onpage 45).

44 Implementing TWS Extended agent for Tivoli Storage Manager

Page 57: Implementing tws extended agent for tivoli storage manager   sg246030

.

Figure 19. Select Jobs to create a new job

3. From the Actions menu, choose New Job.

4. Select the CPU definition in which the new job will reside (Figure 20). InTWS, a CPU must be identified with the job or where the backup scriptresides.

Figure 20. Select the CPU

Chapter 4. Sample scenarios 45

Page 58: Implementing tws extended agent for tivoli storage manager   sg246030

5. Once you have chosen the associated CPU, type the job name and clickOK (Figure 21). The job name should be your identifier for easy ad hocscheduling as well as monitoring. A naming convention is highlyrecommended when planning your TWS environment.

Figure 21. New Job window for database backup

6. Complete the necessary fields of the new Job Definition window(Figure 22 on page 47). Logon refers the user ID that will execute thejob (script or command). Enter the script name or the command, makingsure the path is included (or the .jobmanrc is present in the user’sdirectory. See Tivoli Workload Scheduler 7.0 Planning and Installation Guide, GC32-0422). The path can also be a parameter if necessary(see Tivoli Workload Scheduler 7.0 User’s Guide,GC32-0423 for moredetails on the Parameter object). The Interactive option is for WindowsNT jobs to run interactively on the Windows NT desktop. RecoveryOptions is an important field to consider. When a job does not does notcomplete successfully (or the state is abended) the entered RecoveryJob is executed.

46 Implementing TWS Extended agent for Tivoli Storage Manager

Page 59: Implementing tws extended agent for tivoli storage manager   sg246030

.

Figure 22. Job definition window for Database Backup

7. Choose File->Save and then File->Close.

8. As jobs are entered in the database, utilizing the View Filter option canhelp you search for a specific job. The list of jobs is seen in Figure 23 onpage 48.

Chapter 4. Sample scenarios 47

Page 60: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 23. List of jobs, including BACKUPDB.

Once a job is defined, it must be entered in an existing or new schedule. Thefollowing steps will assist you with schedule definitions:

1. From Composer, choose Schedules (Figure 24).

Figure 24. Selecting Schedules to add a new schedule

48 Implementing TWS Extended agent for Tivoli Storage Manager

Page 61: Implementing tws extended agent for tivoli storage manager   sg246030

2. From the Actions menu, select New, to add a schedule (Figure 25). Ifyou want to change the parameters of an existing schedule, chooseModify.

Figure 25. Creating a new schedule for database backup

3. If you choose the New schedule option, select the CPU associated withthe schedule and enter the schedule name (Figure 26 on page 50).Naming convention methodology is highly recommended for easymonitoring and ad hoc scheduling.

Chapter 4. Sample scenarios 49

Page 62: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 26. Defining a new schedule for database backup

4. Once the correct information is entered, click OK (Figure 27).

Figure 27. New schedule - backup db

5. The Schedule Definition window (Figure 28 on page 51) requiresvarious pieces of information.

50 Implementing TWS Extended agent for Tivoli Storage Manager

Page 63: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 28. On/Except window to definite the new schedule

6. Choose the date on which the schedule will execute from theOn/Except tab (Figure 28). In our scenario, the schedule will runEveryday. Choose this option. If this was a weekly backup, you wouldonly wish to choose Saturday or Sunday. You can also create acalendar with scheduled dates.

Chapter 4. Sample scenarios 51

Page 64: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 29. Options to define a new schedule

7. Under the Options tab, enter the schedule’s run time (Figure 29).Indicate the schedule’s priority, as well as the limit of jobs running perschedule. Please note that the offset cannot be used at the job andschedule level.

52 Implementing TWS Extended agent for Tivoli Storage Manager

Page 65: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 30. Follows Sched/Job window for database backup

8. The Follows Sched/Job option (Figure 30) is one of the many TWSdependency options. For instance, if this schedule consisted of a jobthat starts the backup schedule, you may have this schedule and/or jobdependent on an existing job that exports the database. This means thebackup schedule would only start if the exporting of the database wascompleted successfully or the job state was SUCC.

9. In the Opens Files tab (Figure 31 on page 54) it is not necessary toenter a file as a dependency for our scenario. Leave this blank.

Chapter 4. Sample scenarios 53

Page 66: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 31. Opens Files window for database backup

10. Clicking the Needs Resources tab (Figure 32 on page 55), brings upthe Needs Resources window. Resources represent physical or logicalscheduling resources that can be used as dependencies for jobs andjob streams. The resource may be an available device (a tape or tapedevice). If other schedules/jobs are dependent on the same device, youmay use the resource option to run schedules/jobs in a particularsequence.

54 Implementing TWS Extended agent for Tivoli Storage Manager

Page 67: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 32. Needs resources window for database backup

11. The Jobs tab allows the existing job(s) to be defined for the schedule.You must initially select the CPU and the desired job (Figure 33 onpage 56).

Chapter 4. Sample scenarios 55

Page 68: Implementing tws extended agent for tivoli storage manager   sg246030

.

Figure 33. Jobs window for database backup

12. After selecting the desired job, click the Add button. The job shouldappear in the Current Jobs column (Figure 34). Repeat this step until alldesired jobs are displayed in this column.

Figure 34. Adding jobs to the Current Jobs list

56 Implementing TWS Extended agent for Tivoli Storage Manager

Page 69: Implementing tws extended agent for tivoli storage manager   sg246030

13. When you finish adding jobs, select File->Save, and then File->Close.

14. Your schedule (Figure 35) is now complete and ready to be executedafter a Jnextday run, as it will be part of your production Symphony file.If you wish to submit the schedule immediately, you can do this from theConman window.

Figure 35. New schedule on the List of Schedules

Choose Conman from the main TWS window (Figure 36 on page 58) toexecute the new schedule and/or job. The report displays jobinformation and you can use it for various monthly reports.

Chapter 4. Sample scenarios 57

Page 70: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 36. Selecting Conman from the Maestro (TWS) Main Window

15. If you wish to submit the schedule and/or job immediately, choose theSubmit option from the header tab. In the Submit window, you canchoose Schedules, Jobs, File, or Command. In this case choose Jobor Schedule. Complete the appropriate fields and your job/schedule issubmitted.

You will not be able to display the newly created schedule and/or job until aJnextday run. The Jnextday script processes the following steps:

a. Runs schedulr to select the appropriate schedules for the new day.

b. Runs compiler to create an interim Production Control file.

c. Runs reptr to print the pre-production reports.

d. Stops TWS processing.

e. Runs stageman to carry forward uncompleted schedules, to log theold Production Control file, and to install the new file.

f. Starts TWS processing for the new day.

g. Runs reptr to print the post-production reports from the most recentlog file.

h. Runs logman to log job statistics from the most recent log file.

Important

58 Implementing TWS Extended agent for Tivoli Storage Manager

Page 71: Implementing tws extended agent for tivoli storage manager   sg246030

16. When a Jnextday is completed, choose the appropriate object anddisplay the production environment. Depending on security, this may notbe possible. Ask your TWS administrator for your security options.

Choose the Schedules object to display the schedule name, state ofthe schedule, its priority, the schedule’s duration, the number of jobs inthat schedule, and the schedule’s limit and dependencies.

In our example, the BACKUPDB schedule contains its state (SUCC),priority, start time, and other pertinent information (Figure 37).

Figure 37. BACKUPDB schedule

17. By clicking the right button of the mouse, you can view the standardoutput (Figure 38).

Figure 38. Standard output for database backup

Chapter 4. Sample scenarios 59

Page 72: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 39. Checking the status of a job

18. The standard output (better known in TWS as the stdlist) displays theheader information: logon user, the job ID (or process ID), and the startdate and time (Figure 39 and Figure 40). The body of the stdlistcontains the standard output of the job and its exit code, which willdetermine the status of the job.

Figure 40. Stdlist for BACKUPDB

Follow the same steps when scheduling any job and/or schedule. Thedependencies are the only differences.

60 Implementing TWS Extended agent for Tivoli Storage Manager

Page 73: Implementing tws extended agent for tivoli storage manager   sg246030

Let’s summarize the steps needed to schedule a job in TWS to back up adatabase. To back up a database, you will need to define a copy of a storagepool on your server. Eliminating this copy would result in errors whenscheduling in TWS. To define a copy of a storage pool on your server, pleaserefer to the relevant user guide for your server platform.

1. From the Maestro (TWS) Main Window, click on Composer (DatabaseManager).

2. Choose Jobs from the Scheduling Objects’ selections.

3. From the Actions menu, choose New Job.

4. After you select the corresponding CPU and enter the job name(following your naming conventions).

5. Enter the logon ID. This is the user ID that will execute the job.

6. Enter the script name (including path).

7. Enter the command or script (including path). The path can be enteredin a parameter, in the .jobmanrc file, or in the command or script field.

8. If the job resides on an NT system and it requires a manual intervention,Interactive must be selected.

9. Enter the Recovery Option. If the job does not complete successfully,you must choose an action. The Stop option will wait for your manualnext step. The Continue option would not be used in this scenario.TheRerun option allows the job to be executed again without manualintervention. Figure 41 on page 62 displays the Job Definition window.

Chapter 4. Sample scenarios 61

Page 74: Implementing tws extended agent for tivoli storage manager   sg246030

.

Figure 41. Job Definition window for storage pool backup

10. Select File->Save, and then File->Close.

To define a new schedule for this job, choose Composer, and thenselect Schedules.

Our objective is to create a new schedule.

11. On Actions menu, click New.

12. Choose the associated CPU and enter the Schedule Name.

13. Select the date(s) or pre-defined calendar to execute the schedule aswell as its dependencies (if any).

14. Select File->Save, and then File->Close.

You now have a job and schedule in the TWS database to backup astorage pool. There are several ways to execute your schedule.

a. If you have added this schedule and job in a productionenvironment, you can only submit this schedule in an ad hocfashion. Submit the job or schedule from the Conman window,choosing Submit Schedule or Submit Job, answering thenecessary prompt.

b. If the schedule and job were created in a test environment, you canrerun the Jnextday script from the command line. This will allow theschedule and job to run in the Symphony file (or TWS production

62 Implementing TWS Extended agent for Tivoli Storage Manager

Page 75: Implementing tws extended agent for tivoli storage manager   sg246030

day). The schedule will execute immediately (if no time wasentered) or it will execute on the given time.

To view the state of the job and schedule:

15. Go to Maestro (TWS) Main Window and click on Conman (ConsoleManager).

16. Choose Schedules or Jobs to view the state of the job.

17. To display the standard output or result of the job, right-click the mousebutton and choose Stdlist.

4.1.2 Backup device configurationYou can use this command to backup information about device classdefinitions, library definitions, and drive definitions. If you do not have alibrary installed on your server, you can also back up information about yourdisk.

In order to schedule backup device configuration using TWS, you must definea new schedule and job. Follow the same steps described in Section 4.1.1,“Database backup” on page 43 to prepare your job and schedule.

The Job Definition window for backup device configuration is seen inFigure 42 on page 64.

A new run number is generated when a Jnextday process is executed andall executing jobs will appear as CF (carryforward schedules.)

Note

Chapter 4. Sample scenarios 63

Page 76: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 42. Job Definition window for backup device configuration

Once you create the new schedule and job to back up a device configuration,test your newly created schedule and job as in Section 4.1.1, “Databasebackup” on page 43.

4.1.3 Backup volume historyYou can use this command to back up sequential volumes to one or morefiles.

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for backup volume history is seen in Figure 43 onpage 65.

64 Implementing TWS Extended agent for Tivoli Storage Manager

Page 77: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 43. Job Definition window for backup volume history

4.1.4 Clean volume historyUse this command to delete volume history file records that are no longerneeded (that is, obsolete databases).

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for clean volume history is seen in Figure 44 onpage 66.

Chapter 4. Sample scenarios 65

Page 78: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 44. Job Definition window for clean volume history

4.1.5 Expiration processThis inventory expiration process removes client backup and archive filecopies from server storage based on policy specified in the backup andarchive copy groups of the management classes to which the files are bound.

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for the expiration process is seen in Figure 45 onpage 67.

66 Implementing TWS Extended agent for Tivoli Storage Manager

Page 79: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 45. Job Definition window for the expiration process

4.1.6 Reclamation processReclamation makes the fragmented space on volumes usable again bymoving any remaining active files from one volume to another volume, thusmaking the original volume available for reuse.

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for the reclamation process is seen in Figure 46 onpage 68.

Chapter 4. Sample scenarios 67

Page 80: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 46. Job Definition window for the reclamation process

4.1.7 Migration processYou can use a primary storage pool as the destination for backup files,archive files, or files migrated from client nodes.

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for the migration process is seen in Figure 47 onpage 69.

68 Implementing TWS Extended agent for Tivoli Storage Manager

Page 81: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 47. Job Definition window for the migration process

4.1.8 RestoreYou can restore files, a single database, databases, or volume history files.For more information, see the Tivoli Storage Manager for AIX Administrator’s Reference, GC35-0404.

To define a new job and a new schedule for this event, follow the stepsdescribed in Section 4.1.1, “Database backup” on page 43.

The Job Definition window for restore is seen in Figure 48 on page 70.

Chapter 4. Sample scenarios 69

Page 82: Implementing tws extended agent for tivoli storage manager   sg246030

Figure 48. Job Definition window for restore

4.2 Summary

In this chapter we investigated the following TSM functions that can bescheduled by using TWS Extended agent for TSM.

• Backup device configuration

• Backup volume history

• Clean volume history

• Database backup

• Expiration process

• Migration process

• Reclamation process

• Restore

Instead of using the native TSM scheduler, we used our TWS customExtended agent for TSM to schedule these tasks through TWS. This way wewere able to use TWS’s extended scheduling capabilities.

70 Implementing TWS Extended agent for Tivoli Storage Manager

Page 83: Implementing tws extended agent for tivoli storage manager   sg246030

Appendix A. TSW Extended agent for TSM source code

#!/bin/ksh

set +u

#----------------------------------------------------------------------------

# This method script executes commands on the Tivoli Storage Manager server

# for administrative and client backup purposes

#

# In order to use it, install it in the ~maestro/methods directory,

# and create an x-agent workstation definition that uses it. For

# example:

# CPUNAME TSMADMIN

# OS OTHER

# NODE dontcare

# TCPADDR 9000

# FOR MAESTRO

# HOST TWSFTA

# ACCESS tsmxagent

# END

#

# Create jobs for this x-agent with the following commands in the

# "script name" field on the job definition:

#

# ADMIN DBBACKUP type devclass

#

# where type is either full or incremental

# and where devclass is a devclass name

© Copyright IBM Corp. 2001 71

Page 84: Implementing tws extended agent for tivoli storage manager   sg246030

# defined in TSM.

# This will run a backup database command.

#

#

# ADMIN VHBACKUP filename

#

# where filename is a valid unix file for output

# This will run a backup volhistory command.

#

#

# ADMIN DCBACKUP filename

#

# where filename is a valid unix file for output.

# This will run a backup devconfig command.

#

# ADMIN DELVOLHIST type todate

#

# where type is a string for the type parameter

# and where todate is a date of form MM/DD/YYYY

# This will run a delete volhistory command.

# See the TSM Admin Reference for type parameter.

#

# ADMIN EXPIRE INVENTORY duration

#

# where duration is a numeric value

# This will run an expire inventory command.

#

72 Implementing TWS Extended agent for Tivoli Storage Manager

Page 85: Implementing tws extended agent for tivoli storage manager   sg246030

#

# CLIENT client

#

# where client is the name of a server-prompted

# TSM client ready for scheduling

# This will run a client backup schedule for the

# client specified.

#----------------------------------------------------------------------------

PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/etc/:/posix:/usr/ucb:/usr/bsd

export PATH

# Initialize some of the variables.

SCHEDULE_NAME=""

FORMATTED_SCHED_DATE=""

UNIVERSAL_DATE=""

NODE_NAME=""

JOB_NAME=""

JOB_ID=""

STREAM_LOGON=""

MAESTRO_CPU=""

MAESTRO_HOST=""

MAESTRO_MASTER=""

PORT_NUMBER=""

TEST_OPTIONS=""

CURRENT_RUN_NUMBER=""

REQUIRED_RUN_NUMBER=""

STDLIST=""

TASK=""

Appendix A. TSW Extended agent for TSM source code 73

Page 86: Implementing tws extended agent for tivoli storage manager   sg246030

PARENT="NO"

XARG1=""

XARG2=""

XARG3=""

TMPJOBNAME=""

JOBSTATUS=""

DEVCLASS=""

BACKUPTYPE=""

FILENAMES=""

TODATE=""

DURATION=""

RET9=""

DSMADMC="/usr/bin/dsmadmc"

# The number of seconds to pause between client status checks

CHECKFREQ=10

# The number of times to check client status

JOBTIMEOUT=120

if [ -z "$UNISON_EXEC_PATH" ]

then

PROG_NAME=`basename $0`

EXEC_PATH=`dirname $0`

else

PROG_NAME=`basename $UNISON_EXEC_PATH`

EXEC_PATH=`dirname $UNISON_EXEC_PATH`

fi

BANNER="TWS Extended agent for TSM"

74 Implementing TWS Extended agent for Tivoli Storage Manager

Page 87: Implementing tws extended agent for tivoli storage manager   sg246030

MAE_HOME=`dirname $EXEC_PATH`

# Add maestro home to PATH.

PATH=$MAE_HOME/bin:$MAE_HOME:$PATH

export PATH

echoerr()

# Function to display error messages.

{

TIME=`date +%H:%M`

echo "${PROG_NAME}:$TIME/" "$@" >&2

}

# The name of the TSM adminstrator logon is in the tsmagent.opts file

if [ -f ${PROG_NAME}.opts ]

then

USERID=`awk -F= '$1 ~ /tsmAdmin/ { print $2 }' ${PROG_NAME}.opts`

else

echoerr "Using default admin logon"

USERID="admin"

fi

USAGE="Invalid Usage. See Tivoli Workload Scheduler Users Guide for correctusage ."

print_version()

{

echo "$BANNER"

}

command_exist()

{

if type "$@" 2>&1 | grep -i "not *found" > /dev/null 2>&1

then

Appendix A. TSW Extended agent for TSM source code 75

Page 88: Implementing tws extended agent for tivoli storage manager   sg246030

echoerr "Command $@ not found."

return 1

else

return 0

fi

}

Check_File()

# Check for existance of a file on the extended agent machine.

{

[ -z "$TEST_OPTIONS" ] && TEST_OPTIONS="-f"

test $TEST_OPTIONS "$FILE_NAME"

exit $?

}

fail_job()

{

send_Message "CJ FAIL"

exit 1

}

abend_job()

{

send_Message "CJ ABEND"

exit 1

}

succeed_job()

{

send_Message "JS"

exit 0

76 Implementing TWS Extended agent for Tivoli Storage Manager

Page 89: Implementing tws extended agent for tivoli storage manager   sg246030

}

tsm_admin_command()

# Run dsmserv admin command

{

case $XARG2 in

DBBACKUP|dbbackup)

send_Message "CJ EXEC"

BACKUPTYPE=$XARG3

DEVCLASS=$XARG4

$DSMADMC -id=$USERID -password=$PASSWORD backup db \

devclass=$DEVCLASS type=$BACKUPTYPE scratch=yes wait=yes

[ ! $? -eq 0 ] && fail_job

succeed_job

;;

VHBACKUP|vhbackup)

send_Message "CJ EXEC"

FILENAMES=$XARG3

$DSMADMC -id=$USERID -password=$PASSWORD backup volhistory \

filenames=$FILENAMES

[ ! $? -eq 0 ] && fail_job

succeed_job

;;

DCBACKUP|dcbackup)

send_Message "CJ EXEC"

FILENAMES=$XARG3

$DSMADMC -id=$USERID -password=$PASSWORD backup devconfig \

filenames=$FILENAMES wait=yes

Appendix A. TSW Extended agent for TSM source code 77

Page 90: Implementing tws extended agent for tivoli storage manager   sg246030

[ ! $? -eq 0 ] && fail_job

succeed_job

;;

DELVOLHIST|delvolhist)

send_Message "CJ EXEC"

BACKUPTYPE=$XARG3

TODATE=$XARG4

$DSMADMC -id=$USERID -password=$PASSWORD delete volhistory \

type=$BACKUPTYPE todate=$TODATE

[ ! $? -eq 0 ] && fail_job

succeed_job

;;

EXPIRE|expire)

send_Message "CJ EXEC"

DURATION=$XARG3

$DSMADMC -id=$USERID -password=$PASSWORD expire inventory \

duration=$DURATION wait=yes

[ ! $? -eq 0 ] && fail_job

succeed_job

;;

esac

}

tsm_client_command()

# run tsm client backup

{

TEMPJOBNAME="TWS"$JOB_ID

78 Implementing TWS Extended agent for Tivoli Storage Manager

Page 91: Implementing tws extended agent for tivoli storage manager   sg246030

send_Message "CJ EXEC"

$DSMADMC -id=$USERID -password=$PASSWORD define schedule \

standard $TEMPJOBNAME \

action=incremental startdate=today starttime=now dayofweek=any \

expiration=TODAY

[ ! $? -eq 0 ] && fail_job

$DSMADMC -id=$USERID -password=$PASSWORD define association standard \

$TEMPJOBNAME $XARG2

[ ! $? -eq 0 ] && fail_job

COUNTER=JOBTIMEOUT

while [ 1 ]

do

sleep $CHECKFREQ

COUNTER=`expr $COUNTER - 1`

if [ $COUNTER -eq 0 ]

then

$DSMADMC -id=$USERID -password=$PASSWORD delete schedule \

standard $TEMPJOBNAME

fail_job

else

JOBSTATUS=`$DSMADMC -id=$USERID -password=$PASSWORD query event \

standard \* | grep $TEMPJOBNAME | grep Completed`

if [ ! -z "$JOBSTATUS" ]

then

$DSMADMC -id=$USERID -password=$PASSWORD delete schedule \

standard $TEMPJOBNAME

succeed_job

Appendix A. TSW Extended agent for TSM source code 79

Page 92: Implementing tws extended agent for tivoli storage manager   sg246030

fi

fi

done

$DSMADMC -id=$USERID -password=$PASSWORD delete schedule \

standard $TEMPJOBNAME

[ ! $? -eq 0 ] && fail_job

}

Launch_Job()

# Launch the job

{

if [ $# -lt 2 ]; then

echoerr "Invalid job definition. Too few arguments!"

fail_job

fi

[ -z "$SCRIPT_NAME" ] && exit 1

touch "$STDLIST"

TMP_PATH=/tmp

XARG1=`echo "$SCRIPT_NAME" | cut -d' ' -f1`

XARG2=`echo "$SCRIPT_NAME" | cut -d' ' -f2`

XARG3=`echo "$SCRIPT_NAME" | cut -d' ' -f3`

XARG4=`echo "$SCRIPT_NAME" | cut -d' ' -f4`

case $1 in

ADMIN|admin)

tsm_admin_command $@

;;

CLIENT|client)

tsm_client_command $@

80 Implementing TWS Extended agent for Tivoli Storage Manager

Page 93: Implementing tws extended agent for tivoli storage manager   sg246030

;;

*)

echoerr "Invalid job definition. Must be ADMIN or CLIENT!"

fail_job

esac

exit 0

}

Check_Connection()

#Check connection

{

exit 0

}

Manage_Job()

{

exit 1

}

send_Message()

{

echo "%" "$@"

return 0

}

echo $BANNER

if command_exist parms

then

PASSWORD=`parms TSMPASS`

else

echoerr "Could not find the TWS parms utility."

Appendix A. TSW Extended agent for TSM source code 81

Page 94: Implementing tws extended agent for tivoli storage manager   sg246030

exit 3

fi

#Parse the arguments

while [ $# -gt 0 ]

do

OPT="$1"

[ "`echo %$OPT | cut -c2`" != "-" ] && break

shift

case $OPT in

-c)

OPT_ARG="$1"

shift

MAESTRO_CPU=`echo "$OPT_ARG" | cut -d',' -f1`

MAESTRO_HOST=`echo "$OPT_ARG" | cut -d',' -f2`

MAESTRO_MASTER=`echo "$OPT_ARG" | cut -d',' -f3`

;;

-d)

OPT_ARG="$1"

shift

FORMATTED_SCHED_DATE=`echo "$OPT_ARG" | cut -d',' -f1`

UNIVERSAL_DATE=`echo "$OPT_ARG" | cut -d',' -f2`

;;

-j)

OPT_ARG="$1"

shift

JOB_NAME=`echo "$OPT_ARG" | cut -d',' -f1`

JOB_ID=`echo "$OPT_ARG" | cut -d',' -f2`

82 Implementing TWS Extended agent for Tivoli Storage Manager

Page 95: Implementing tws extended agent for tivoli storage manager   sg246030

;;

-l)

OPT_ARG="$1"

shift

STREAM_LOGON="$OPT_ARG"

;;

-n)

OPT_ARG="$1"

shift

NODE_NAME="$OPT_ARG"

;;

-o)

OPT_ARG="$1"

shift

STDLIST="$OPT_ARG"

;;

-p)

OPT_ARG="$1"

shift

PORT_NUMBER="$OPT_ARG"

;;

-q)

OPT_ARG="$1"

shift

TEST_OPTIONS="$OPT_ARG"

;;

-r)

Appendix A. TSW Extended agent for TSM source code 83

Page 96: Implementing tws extended agent for tivoli storage manager   sg246030

OPT_ARG="$1"

shift

CURRENT_RUN_NUMBER=`echo "$OPT_ARG" | cut -d',' -f1`

REQUIRED_RUN_NUMBER=`echo "$OPT_ARG" | cut -d',' -f2`

;;

-s)

OPT_ARG="$1"

shift

SCHEDULE_NAME="$OPT_ARG"

;;

-t)

OPT_ARG="$1"

shift

TASK="$OPT_ARG"

;;

-V)

print_version

exit 0

;;

--)

break

;;

*)

echoerr "$USAGE"

exit 1

;;

esac

84 Implementing TWS Extended agent for Tivoli Storage Manager

Page 97: Implementing tws extended agent for tivoli storage manager   sg246030

done

REMAINING_ARGS="$*"

if [ ! "$TASK" = "CC" ]

then

if [ "$#" = "0" ] || [ -z "$TASK" ]

then

echoerr "$USAGE"

exit 1

fi

fi

case $TASK in

CF)

FILE_NAME="$REMAINING_ARGS"

Check_File

;;

MJ)

JOB_PID=`echo "$REMAINING_ARGS" | cut -d" " -f1`

STDLIST=`echo "$REMAINING_ARGS" | cut -d" " -f2`

Manage_Job

;;

LJ)

SCRIPT_NAME="$REMAINING_ARGS"

send_Message "CJ WAIT"

Launch_Job $SCRIPT_NAME

;;

CC)

Check_Connection

Appendix A. TSW Extended agent for TSM source code 85

Page 98: Implementing tws extended agent for tivoli storage manager   sg246030

;;

*)

echoerr $USAGE

send_Message "UT $USAGE"

exit 2

;;

esac

exit 3

86 Implementing TWS Extended agent for Tivoli Storage Manager

Page 99: Implementing tws extended agent for tivoli storage manager   sg246030

Appendix B. Using the additional material

This redbook also contains Web material. See the appropriate section below for instructions on using and downloading Web material.

B.1 Locating the additional material on the Internet

The Web material associated with this redbook is available in softcopy on the Internet from the IBM Redbooks Web server. Point your Web browser to:

ftp://www.redbooks.ibm.com/redbooks/SG246030

Alternatively, you can go to the IBM Redbooks Web site at:

ibm.com/redbooks

Select Additional materials and open the directory that corresponds with the redbook form number.

B.2 Using the Web material

The additional Web material that accompanies this redbook includes the following:

File name DescriptionTSMX-agent.zip TWS Extended agent for Tivoli Storage Manager

code (zipped)X-agent.zip Warren Gill’s presentation about how to write a

TWS Extended agent (zipped and PowerPoint Viewer included)

B.2.1 How to use the Web material

Create a subdirectory (folder) on your workstation and copy the contents of the Web material into this folder.

© Copyright IBM Corp. 2001 87

Page 100: Implementing tws extended agent for tivoli storage manager   sg246030

88 Implementing TWS Extended agent for Tivoil Storage Manager

Page 101: Implementing tws extended agent for tivoli storage manager   sg246030

Appendix C. Special notices

This publication is intended to help Tivoli professionals who want write a Tivoli Workload Scheduler Extended agent or to integrate Tivoli Workload Scheduler and Tivoli Storage Manager. The information in this publication is not intended as the specification of any programming interfaces that are provided by Tivoli Workload Scheduler or Tivoli Storage Manager. See the PUBLICATIONS section of the IBM Programming Announcement for Tivoli Workload Scheduler and Tivoli Storage Manager for more information about what publications are considered to be product documentation.

References in this publication to IBM products, programs or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent program that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program or service.

Information in this book was developed in conjunction with use of the equipment specified, and is limited in application to those specific hardware and software products and levels.

IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785.

Licensees of this program who wish to have information about it for the purpose of enabling: (i) the exchange of information between independently created programs and other programs (including this one) and (ii) the mutual use of the information which has been exchanged, should contact IBM Corporation, Dept. 600A, Mail Drop 1329, Somers, NY 10589 USA.

Such information may be available, subject to appropriate terms and conditions, including in some cases, payment of a fee.

The information contained in this document has not been submitted to any formal IBM test and is distributed AS IS. The use of this information or the implementation of any of these techniques is a customer responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. While each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee

© Copyright IBM Corp. 2001 89

Page 102: Implementing tws extended agent for tivoli storage manager   sg246030

that the same or similar results will be obtained elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

Any pointers in this publication to external Web sites are provided for convenience only and do not in any manner serve as an endorsement of these Web sites.

The following terms are trademarks of the International Business Machines Corporation in the United States and/or other countries:

The following terms are trademarks of other companies:

Tivoli, Manage. Anything. Anywhere.,The Power To Manage., Anything. Anywhere.,TME, NetView, Cross-Site, Tivoli Ready, Tivoli Certified, Planet Tivoli, and Tivoli Enterprise are trademarks or registered trademarks of Tivoli Systems Inc., an IBM company, in the United States, other countries, or both. In Denmark, Tivoli is a trademark licensed from Kjøbenhavns Sommer - Tivoli A/S.

C-bus is a trademark of Corollary, Inc. in the United States and/or other countries.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and/or other countries.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States and/or other countries.

PC Direct is a trademark of Ziff Communications Company in the United States and/or other countries and is used by IBM Corporation under license.

ActionMedia, LANDesk, MMX, Pentium and ProShare are trademarks of Intel Corporation in the United States and/or other countries.

UNIX is a registered trademark in the United States and other countries

IBM ®CTe (logo)® Lotus NotesNetfinityRedbooks Logo System/390

AS/400CurrentLotusNotesRedbooksRS/6000XT

90 Implementing TWS Extended agent for Tivoli Storage Manager

Page 103: Implementing tws extended agent for tivoli storage manager   sg246030

licensed exclusively through The Open Group.

SET, SET Secure Electronic Transaction, and the SET Logo are trademarks owned by SET Secure Electronic Transaction LLC.

Other company, product, and service names may be trademarks or service marks of others.

Appendix C. Special notices 91

Page 104: Implementing tws extended agent for tivoli storage manager   sg246030

92 Implementing TWS Extended agent for Tivoli Storage Manager

Page 105: Implementing tws extended agent for tivoli storage manager   sg246030

Appendix D. Related publications

The publications listed in this section are considered particularly suitable for a more detailed discussion of the topics covered in this redbook.

D.1 IBM Redbooks collections

Redbooks are also available on the following CD-ROMs. Click the CD-ROMs button at ibm.com/redbooks for information about all the CD-ROMs offered, updates and formats.

D.2 Other resources

These publications are also relevant as further information sources:

• Tivoli Workload Scheduler 7.0 Reference Guide, GC32-0424

• Tivoli Workload Scheduler 7.0 Planning and Installation Guide, GC32-0422

• Tivoli Workload Scheduler 7.0 User’s Guide,GC32-0423

• Tivoli Storage Manager for AIX Administrator’s Reference, GC35-0404

D.3 Referenced Web sites

These Web sites are also relevant as further information sources:

• http://www.tivoli.com/ Tivoli’s external Web site

CD-ROM Title Collection Kit Number

IBM System/390 Redbooks Collection SK2T-2177IBM Networking Redbooks Collection SK2T-6022IBM Transaction Processing and Data Management Redbooks Collection SK2T-8038IBM Lotus Redbooks Collection SK2T-8039Tivoli Redbooks Collection SK2T-8044IBM AS/400 Redbooks Collection SK2T-2849IBM Netfinity Hardware and Software Redbooks Collection SK2T-8046IBM RS/6000 Redbooks Collection SK2T-8043IBM Application Development Redbooks Collection SK2T-8037IBM Enterprise Storage and Systems Management Solutions SK3T-3694

© Copyright IBM Corp. 2001 93

Page 106: Implementing tws extended agent for tivoli storage manager   sg246030

94 Implementing TWS Extended agent for Tivoli Storage Manager

Page 107: Implementing tws extended agent for tivoli storage manager   sg246030

How to get IBM Redbooks

This section explains how both customers and IBM employees can find out about IBM Redbooks, redpieces, and CD-ROMs. A form for ordering books and CD-ROMs by fax or e-mail is also provided.

• Redbooks Web Site ibm.com/redbooks

Search for, view, download, or order hardcopy/CD-ROM Redbooks from the redbooks Web site. Also read redpieces and download additional materials (code samples or diskette/CD-ROM images) from this redbooks site.

Redpieces are redbooks in progress; not all redbooks become redpieces and sometimes just a few chapters will be published this way. The intent is to get the information out much quicker than the formal publishing process allows.

• E-mail Orders

Send orders by e-mail including information from the IBM Redbooks fax order form to:

• Telephone Orders

• Fax Orders

This information was current at the time of publication, but is continually subject to change. The latest information may be found at the Redbooks Web site.

In United States or CanadaOutside North America

e-mail [email protected] information is in the “How to Order” section at this site:http://www.elink.ibmlink.ibm.com/pbl/pbl

United States (toll free)Canada (toll free)Outside North America

1-800-879-27551-800-IBM-4YOUCountry coordinator phone number is in the “How to Order” section at this site:http://www.elink.ibmlink.ibm.com/pbl/pbl

United States (toll free)CanadaOutside North America

1-800-445-92691-403-267-4455Fax phone number is in the “How to Order” section at this site:http://www.elink.ibmlink.ibm.com/pbl/pbl

IBM employees may register for information on workshops, residencies, and Redbooks by accessing the IBM Intranet Web site at http://w3.itso.ibm.com/ and clicking the ITSO Mailing List button. Look in the Materials repository for workshops, presentations, papers, and Web pages developed and written by the ITSO technical professionals; click the Additional Materials button. Employees may access MyNews at http://w3.ibm.com/ for redbook, residency, and workshop announcements.

IBM Intranet for Employees

© Copyright IBM Corp. 2001 95

Page 108: Implementing tws extended agent for tivoli storage manager   sg246030

IBM Redbooks fax order form

Please send me the following:

We accept American Express, Diners, Eurocard, Master Card, and Visa. Payment by credit card notavailable in all countries. Signature mandatory for credit card payment.

Title Order Number Quantity

First name Last name

Company

Address

City Postal code

Telephone number Telefax number VAT number

Invoice to customer number

Country

Credit card number

Credit card expiration date SignatureCard issued to

96 Implementing TWS Extended agent for Tivoli Storage Manager

Page 109: Implementing tws extended agent for tivoli storage manager   sg246030

Abbreviations and acronyms

ADSM ADSTAR Distributed Storage Manager

AIX Advanced Interactive Executive

API application programming interface

CF check file

CLI command line interface

CPU central processing unit

ESM Enterprise Systems Management

FTA Fault-tolerant Agent

GRT Global Response Team

GS get status of job

GUI graphical user interface

IBM International Business Machines Corporation

ITSO International Technical Support Organization

JSC Job Scheduling Console

LJ launch job

MJ manage job

MVS Multiple Virtual Storage

OPC Operations, Planning and Control

PID process identification

RFC Remote Function Call

SAN Storage Area Networks

SLA service level agreement

TCP Transmission Control Protocol

TME Tivoli Management Environment

© Copyright IBM Corp. 2001

TMR Tivoli Management Region

TSM Tivoli Storage Manager

TWS Tivoli Workload Scheduler

97

Page 110: Implementing tws extended agent for tivoli storage manager   sg246030

98 Implementing TWS Extended agent for Tivoli Storage Manager

Page 111: Implementing tws extended agent for tivoli storage manager   sg246030

Symbols.jobmanrc 46

Aabended 46access method 4, 5ADSM

See ADSTAR Distributed Storage ManagerADSTAR Distributed Storage Manager 8application programming interface 1archival storage 8archive 7, 8

BBackup Master 3backup volumes 30batch job execution 2Batchman process 5

CCA7 7centralized database 3CF task 14client backups 1command line interface 1, 13commit 34common interface 4compiler 58

Ddata protection 8databases 8DEFINE ASSOCIATION 9DEFINE SCHEDULE 9DELETE SCHEDULE 9dependencies 1device class definitions 29disaster recovery 8DOCOMMAND 6Domain Manager 3, 4drive definitions 30dump volumes 30duration 32

Ee-mail 8

export volumes 30Extended agent 4, 9, 10, 13

access method 10access method interface 15API 1architecture 5example 18executing the method 21host 10interface 4interface between TWS 4jobname 17killing a job 21logical workstation definition 10messages 20method command line syntax 15method options file 14method troubleshooting 21nodename 17password 9portnumber 17processing 5qualifier 17referenced 10sample options file 14sample scenarios 43segregation of applications 4special login information 14stdlist 17troubleshooting 21user 17Windows NT 15workstation definition 13

external job 6external system 13

Ffast recovery 7Fault-tolerant Agent

See FTAFollows Sched/Job option 53foreign platforms 4FTA 5Full Status 3

Ggroupware 8

99

Page 112: Implementing tws extended agent for tivoli storage manager   sg246030

Hhierarchical space management 8

IInteractive option 46

JJava 1JES2 3JES3 3job execution 1job ID 6job number 6Job Scheduling Console 1, 2, 13job stream execution 1jobman.exe 5jobmanrc 4jobmon.exe 5JSC

See Job Scheduling Console

LLAN-free backup 7launch a job 6library definitions 29line 13LJ task 14local dependencies 4logical workstation 13

MMaestro 34manage a job 6management hub 4Master Domain Manager 3method.opts 5methods directory 4migration 7MJ task 14MVS JES2 3MVS JES3 3

NNeeds Resources 54Network agent 3network communication 5

NEXTSTGPOOL 28node 14

Ooffset 52OPC 4open API 7OPENS dependency 6Opens Files 53operator prompts 1Oracle Applications 3, 7

PPeopleSoft 3, 7physical workstation 13PID 18port definition 2, 6production run number 6

QQUERY EVENT 9

RRecovery Options 46remote console 3Remote Function Call 5repeater 3reptr 58Resolve Dependencies 3retrieval 7roll over 1root user ID 5run cycle 1

SSAN 7SAP R/3 3

Batch 7schedule name 6scheduling API 4scheduling protocol 4schedulr 58SCRIPTNAME 6service level agreement 43shell script 4skipdirs 32SLA

100 Implementing TWS Ex tended agent for Tivoli Storage Manager

Page 113: Implementing tws extended agent for tivoli storage manager   sg246030

See service level agreementspace management 7stageman 58Standard agent 3stdout 41Storage Area Networks

See SANstorage resource management 8subfile backup 7Submit option 58Symphony file 62synchronize job 16

Ttape sharing 7tcpaddr 14timeout 9Tivoli Job Scheduling Services 2Tivoli Management Framework 2Tivoli Storage Management 8Tivoli Storage Manager 11

See TSMTivoli TWS Connector 2troubleshooting 1TSM 7, 11, 23

Administrative Client Interface 9archive process 8backup 23backup storage pool 25backup volume history 41client backups 9Composer 34data protection 8database 23, 31disaster recovery 8Extended agent benefits 9incremental backup 7Main Window 34migration 23, 27overview 7processes 23reclamation 23, 26Restore Database 41restore database 32retrieval process 8scheduling facility 1scratch volumes 31task 9

volume history 23TSM scenarios

backup device configuration 63backup volume history 64clean volume history 65database backup 43expiration process 66migration process 68reclamation process 67restore 69

TSMPASS 9tsmxagent 9tsmxagent.opts 9TWS 2, 4

architecture 3Backup Master 3calendars 2concepts 2Conman 57Connector 2CPU 38current run number 17database 1database files 3default user 34Domain Manager 3Extended agent 3Fault-tolerant Agent 3Files 39job streams 2Jobs 38JSC Client 3legacy user interface 43Master 5Master Domain Manager 3methods directory 9network 2plan 1production day 62production plan 13Prompts 38Recovery Options 37Resources 38scaling 3Schedules 38scheduling API 4separate networks 3server 5Standard agent 3

101

Page 114: Implementing tws extended agent for tivoli storage manager   sg246030

standard output 60task options 16terminology 2types of workstations 3versions prior to 7.0 43workstations 2

UUNIX Local 7UNIX Remote Shell 7

VView Filter option 47virtual resources 1vital record retention 8

Wwait 32wgetmethod 7

102 Implementing TWS Ex tended agent for Tivoli Storage Manager

Page 115: Implementing tws extended agent for tivoli storage manager   sg246030

© Copyright IBM Corp. 2001 103

IBM Redbooks review

Your feedback is valued by the redbook authors. In particular we are interested in situations where a redbook "made the difference" in a task or problem you encountered. Using one of the following methods, please review the redbook, addressing value, subject matter, structure, depth and quality as appropriate.

• Use the online Contact us review redbook form found at ibm.com/redbooks • Fax this form to: USA International Access Code + 1 845 432 8264 • Send your comments in an Internet note to [email protected]

Document NumberRedbook Title

SG24-6030-00Implementing TWS Extended agent for Tivoli Storage Manager

Review

What other subjects would you like to see IBM Redbooks address?

Please rate your overall satisfaction:

O Very Good O Good O Average O Poor

Please identify yourself as belonging to one of the following groups:

O Customer O Business Partner O Solution DeveloperO IBM, Lotus or Tivoli EmployeeO None of the above

Your e-mail address:The data you provide here may be used to provide you with information from IBM or our business partners about our products, services or activities.

O Please do not use the information collected here for future marketing or promotional contacts or other communications beyond the scope of this transaction.

Questions about IBM’s privacy policy?

The following link explains how we protect your personal information.ibm.com/privacy/yourprivacy/

Page 116: Implementing tws extended agent for tivoli storage manager   sg246030
Page 117: Implementing tws extended agent for tivoli storage manager   sg246030

(0.2”spine)0.17”<->0.473”

90<->249 pages

Implem

enting TWS Extended agent for Tivoli Storage M

anager

Page 118: Implementing tws extended agent for tivoli storage manager   sg246030
Page 119: Implementing tws extended agent for tivoli storage manager   sg246030
Page 120: Implementing tws extended agent for tivoli storage manager   sg246030

®

SG24-6030-00 ISBN 0738419753

INTERNATIONAL TECHNICALSUPPORTORGANIZATION

BUILDING TECHNICALINFORMATION BASED ONPRACTICAL EXPERIENCE

IBM Redbooks are developed by the IBM International Technical Support Organization. Experts from IBM, Customers and Partners from around the world create timely technical information based on realistic scenarios. Specific recommendations are provided to help you implement IT solutions more effectively in your environment.

For more information:ibm.com/redbooks

Implementing TWSExtended agent for Tivoli Storage Manager

Insider’s guide to writing a TWS Extended agent

Ready-to-use solution to integrate TSM and TWS

TSM Extended agent code included

Tivoli Workload Scheduler (TWS) is Tivoli’s strategic, multiplatform distributed scheduling product that provides high-volume, complex scheduling capability. Although TWS has native support for many platforms and applications, it is possible to extend the TWS’s robust scheduling capabilities to cover platforms and applications beyond those TWS supports. The way to do this is to write an Extended agent. This redbook shows you how to write a TWS Extended agent that allows you to schedule on platforms and applications for which TWS has no native agent. Tivoli Storage Manager (TSM) is used as a sample application to integrate with TWS using the Extended agent. Using TWS’s scheduling facility allows you to assign dependencies among TSM scheduled tasks or to assign limits or priorities. By extending TWS to schedule these TSM tasks, you can take advantage of its advanced scheduling capabilities.

This redbook will be essential for those who will write a TWS Extended agent or will use TWS to schedule TSM functions.