search cancel

Using a script to add additional value for a Threshold SpectroWatch in Spectrum


Article ID: 197700


Updated On:


CA Spectrum


Using a script to add additional value for a Threshold SpectroWatch in Spectrum


Any Spectrum version


Spectrum contains functionality to execute a script for a Threshold SpectroWatch. This gives the user flexibility to add additional value processing the results of a threshold watch.

The following is from the "Create and Edit a Watch" section of the documentation:

Specify the following Script options. The Script options let you specify a script to execute if the watch threshold is violated or cleared.

Execute a Script when threshold:
Enables script execution. Select the threshold condition that triggers script execution.

Execute for each instance:
If enabled and the watch expression contains list attributes, the script is executed for each instance that meets the threshold condition.

Script File:
Specifies the script file on the SpectroSERVER to execute. If no directory path is specified, the default directory, <$SPECROOT>/SS-Tools/SwScript, is used. You can change the default directory by setting sw_script_path in the file <$SPECROOT>/SS/.watchrc.

Additional Information

1. Spectrum passes the following information to the script:

Model Type Name
Model Handle
Model Name
Alarm ID
Cause Code
Repair Person
Alarm Status
Script Type
Watch Name
Watch Creator
Watch Source
Watch Source Value
Watch Reference
Watch Reference Value
Watch Reset
Watch Reset Value

2. The script can incorporate Command Line Interface (CLI) commands to help gather additional information from the model where the threshold was exceeded.

3. Specify the complete patch name if redirecting information to a file. If not, the script will assume the root directory which the user may not have permissions to write to.