Running Scripts - Overview

 

Tivoli SRM has two facilities for automatically executing scripts within your environment:

 

 

 

Both facilities are script-based, allowing you to use any third-party tools for actions, such as archiving, back-up and recovery, or provisioning.

 

How does Tivoli Storage Resource Manager run scripts?

 

During installation, Tivoli Storage Resource Manager creates a directory called: \program files\tivoli\TSRM\scripts. This is created on every Server and every Agent machine.

There are two main reasons  to run a script:  

 

 

1.  When a script is run, the Server looks in its local \scripts directory. If the Server can resolve that script name, it loads that script, sends it to the Agent where you designated the script to be run.

 

2. The Agent receives the script, names it as temporary file, and runs it. After the Agent has finished running the script, the temporary file is deleted.

There are two conditions why the script may not run when sent by the Server:

 

a. The script already exists in the Agent's \scripts directory. In this case, the Agent will ignore the script sent by the Server, and just run its local version.

 

b. If you did not check the Agent may run scripts sent by server option in the installation parameters screen, the Agent will ignore the script sent by the server.

 

If you checked the Agent may run scripts sent by server option in the installation parameters screen, the Agent will run scripts sent by the Server. The advantage of checking this option is you can store only one copy of the script on the Servers' \script directory, and do not have to keep a copy of the script on every Agent machine. Then when a script needs to be run on a particular Agent, the Server will access the script from it's local \script directory and send it to the Agent to be run.  When the script is pushed out to the Agent, it is named as temporary file. After the Agent has finished running the script, the temporary file is deleted.

 

We recommend storing the scripts you want to run globally (across all your Agents) on the Server machine. Store the scripts you want to run locally on the Agent machines where you want them to run.

Sample Scenario

If a tablespace's free space went below a certain threshold, you can run a script based on that threshold on the machine where the tablespace exists. For this example, you would not target a particular Agent on which to run the script, but instead the script should run on the computer that has the tablespace low freespace condition.

 

If you did NOT check the Agent may run scripts sent by server option, you must make sure that the appropriate script is stored on every single Agents' \scripts directory. However, if you checked the Agent may run scripts sent by server option, the Server will push out the script to the Agent machine that has the low freespace condition. In this case, you only have to ensure that the script exists on the Servers' \scripts directory, and not on any of the Agents's scripts directory. The script will then run on whatever Agent has the low freespace condition.