- changed status to closed
Feature request: pass data about the event to the script for the "exec" statement
I would like to get my scripts which are executed on alert conditions more useful. For this it would be nice if data about the alert would be passed to the script. A small simplified example:
check filesystem storage_1 with path /path1
if space usage > 80% exec "cleanup.py"
check filesystem storage_1 with path /path1
if space usage > 80% exec "cleanup.py"
Then I would like to get my script to know e.g. the path:
cleanup.sh --path /path1
... and could do something amazing inside my script with the info about the path (or the monit status or whatever info Monit provides for me).
Best would be to pass all the data which could be seen in monit status
for a particular Service/Process/Network/Filesystem in an defined way to the script. If there is an "API" defined which the script has to/can provide as command line parameters this should not be a problem.
For backward compatiblilty it would maybe be the best to have the old style exec
statement and a new fashioned super awesome exec_v2
statement ;-)
Comments (2)
-
repo owner -
repo owner - removed version
Removing version: 5.11 (automated comment)
- Log in to comment
Hello Marco, Monit provides set of environment variables to the executed program, see Monit manual for more details: http://mmonit.com/monit/documentation/monit.html#ENVIRONMENT