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.
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.
1. Spectrum passes the following information to the script:
Model Type Name
Watch Source Value
Watch Reference Value
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.