Feature request: pass data about the event to the script for the "exec" statement

Issue #149 closed
Marco Roose created an issue

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)

  1. Log in to comment