Automated Script Responses
For any line in [PROTOPDIR]/etc/alert.[*].cfg, if the keyword “script” is included in the action list, ProTop will search for and execute the script named [PROTOPDIR]/bin/[metricName]. ProTop will then send a new alert to the portal containing the output of that script. This will occur in addition to any other items in the action list for that alert.
CAREFUL: The spelling and case must exactly match the Alertable Metric Name found in 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 an alert to the portal containing the output of your script. It will also send the normal "alert" to the portal as well.
You can view the output of your script (script result:) in the portal by hovering over the alert entry in the ProTop Alerts Dashboard: