Running Scripts in Response to an Alert

 

When you specify an alert for a job, you can define a script to be run when the triggered condition is met.

 

1. Check Run Script on the Alert tab.

 

2. Click Define. The Specify Script dialog box displays.

 

3. Enter the name of the script in the Script Name field.
 

Note: This script name is used to tell the Server what script to send to the Agent. If the script sent by the Server is run by the Agent, the name of the script will not be the name you specify in the Script Name field. Instead, the Agent names the script as temporary file, runs it, then deletes it after the script has run. Because of this, you should not have code in your script that depends on this script name.

 

4. Specify where you want the script to run in the Where to Run field. You can select a specific Agent or the triggering computer. For some types of alerts such as Job Failed, you will not have the option to run the script on the triggering computer.

 

5. The Script Parameters section displays what parameters will be passed to the script when it is run. Each triggering condition passes different parameters. The parameters will be passed in the order specified on the dialog box.
 

6. When you are finished, press OK.  The script will run when the Alert is triggered.
 

 

For more information, see Running Scripts - Overview.