For any line in [PROTOPDIR]/etc/alert.[*].cfg, if the keyword “script” is included in the alert action list, ProTop will search for and execute the script named [PROTOPDIR]/bin/[metricName] if found.
ProTop will then send a white alert to the portal containing the script's output. This will occur in addition to any other items in the action list for that alert.
NOTE: At the moment, on Windows, you need two files in bin. One file named for the metric (it can be empty) and a bat file named for the metric that does the work you want done. So, e.g. bin\otrx and bin\otrx.bat.
CAREFUL: The spelling and case must match the Alertable Metric Name found on the Alertable Metrics pages.
For example, to have ProTop run a script that you wrote, which provides more information about the state of the lock table when this alert is fired, add this line to your [PROTOPDIR]/etc/alert.[*].cfg:
lkTableSize num > 500000 "" "daily" "&1 &2 &3" script,alert
This says when the lkTableSize exceeds 500000, ProTop will look for and execute [PROTOPDIR]/bin/lkTableSize (notice, no file name extension), passing in these parameters:
- $1=metricName
- $2=friendlyName
- $3=full path DB
- $4=metricValue
It will then send a white alert to the portal containing the output of your script and the normal yellow alert.
You can view the output of your script (script result:) in the portal by hovering over the alert entry in the ProTop Alerts Dashboard: