* Add actions on alerts (issue #132). It is now possible to run action (command line) by triggers. Action could containq {Mustache} {{tag}} (Mustache) with stat value.
@@ -671,6 +671,26 @@ Each alert message displays the following information:
...
@@ -671,6 +671,26 @@ Each alert message displays the following information:
4. {min,avg,max} values or number of running processes for monitored
4. {min,avg,max} values or number of running processes for monitored
processes list alerts
processes list alerts
Actions
-------
Glances can trigger actions on events.
By action, we mean all shell command line. For example, if you want to execute the foo.py script if the last 5 minutes load are critical then add the action line to the Glances configuration file:
[load]
critical=5.0
critical_action=python /path/to/foo.py
All the stats are usable in the command line by the use of the {{mustache}} syntax. Another example to create a log file containing used vs total disk space if a warning space trigger is reached: