diff options
author | Alessio Sergi <al3hex@gmail.com> | 2016-03-02 13:29:19 +0100 |
---|---|---|
committer | Alessio Sergi <al3hex@gmail.com> | 2016-03-06 19:16:37 +0100 |
commit | c1e1ad4da5d95b50c1426f7cba879e73d3dc12a8 (patch) | |
tree | d301afe06ef8c404b9b6c8a03e9f4dd47b51d406 /docs/aoa/actions.rst | |
parent | fcc65bf14d0ba5c1b812cf63047db489bf2b6c22 (diff) |
Use Sphinx for doc
Diffstat (limited to 'docs/aoa/actions.rst')
-rw-r--r-- | docs/aoa/actions.rst | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/aoa/actions.rst b/docs/aoa/actions.rst new file mode 100644 index 00000000..5ce40bcd --- /dev/null +++ b/docs/aoa/actions.rst @@ -0,0 +1,34 @@ +.. _actions: + +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: + +.. code-block:: ini + + [load] + critical=5.0 + critical_action=python /path/to/foo.py + +All the stats are available in the command line through the use of the +`{{mustache}}`_ syntax. Another example would be to create a log file +containing used vs total disk space if a space trigger warning is +reached: + +.. code-block:: ini + + [fs] + warning=70 + warning_action=echo {{mnt_point}} {{used}}/{{size}} > /tmp/fs.alert + +.. note:: + You can use all the stats for the current plugin. See + https://github.com/nicolargo/glances/wiki/The-Glances-2.x-API-How-to + for the stats list. + +.. _{{mustache}}: https://mustache.github.io/ |