diff options
author | Alessio Sergi <al3hex@gmail.com> | 2017-03-12 18:52:17 +0100 |
---|---|---|
committer | Alessio Sergi <al3hex@gmail.com> | 2017-03-12 18:52:17 +0100 |
commit | 937f2faf9aa0e3b362fac62dbb4dac7fb06c21fb (patch) | |
tree | be068e73be2e2fe184fa44efc5375087025a0714 /docs/aoa/amps.rst | |
parent | 23a65b56f2eac3a02074fd3f454f3a3bcf7ea64e (diff) |
Update doc
Diffstat (limited to 'docs/aoa/amps.rst')
-rw-r--r-- | docs/aoa/amps.rst | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/docs/aoa/amps.rst b/docs/aoa/amps.rst index 21c6ac65..6ea11083 100644 --- a/docs/aoa/amps.rst +++ b/docs/aoa/amps.rst @@ -3,16 +3,17 @@ Applications Monitoring Process =============================== -Thanks to Glances and it AMP module, you can add specific monitoring -to running process. AMP are defined in the Glances configuration file. +Thanks to Glances and its AMP module, you can add specific monitoring to +running processes. AMPs are defined in the Glances configuration file. -You can disable AMP using the --disable-amps option or pressing the `A` shortkey. +You can disable AMP using the ``--disable-amps`` option or pressing the +``A`` key. Simple AMP ---------- -For example, a simple AMP which monitor the CPU/MEM of all Python processes -can be define using: +For example, a simple AMP that monitor the CPU/MEM of all Python +processes can be defined as follows: .. code-block:: ini @@ -21,15 +22,17 @@ can be define using: regex=.*python.* refresh=3 -Every 3 seconds (*refresh*) and if the *enable* key is true, Glances will -filter the running processes list thanks to the .*python.* regular -expression (*regex*). The default behavor for an AMP is to display: -the number of matching processes, the CPU and MEM: +Every 3 seconds (``refresh``) and if the ``enable`` key is true, Glances +will filter the running processes list thanks to the ``.*python.*`` +regular expression (``regex``). + +The default behavior for an AMP is to display the number of matching +processes, CPU and MEM: .. image:: ../_static/amp-python.png -You can also define the minimum (*countmin*) and/or maximum (*countmax*) process -number. For example: +You can also define the minimum (``countmin``) and/or maximum +(``countmax``) process number. For example: .. code-block:: ini @@ -40,17 +43,19 @@ number. For example: countmin=1 countmax=2 -With this configuration, if the number of running Python script is higher than 2 -then the AMP is display with a purple color (red if < countmin): +With this configuration, if the number of running Python scripts is +higher than 2, then the AMP is displayed with a purple color (red if +less than countmin): .. image:: ../_static/amp-python-warning.png -User define AMP ---------------- +User defined AMP +---------------- -If you need to execute a specific command line, you can use the *command* option. -For example, if you want to display the Dropbox process status, you can define the -following section in the Glances configuration file: +If you need to execute a specific command line, you can use the +``command`` option. For example, if you want to display the Dropbox +process status, you can define the following section in the Glances +configuration file: .. code-block:: ini @@ -63,27 +68,29 @@ following section in the Glances configuration file: command=dropbox status countmin=1 -The *dropbox status* command line will be executed and displayed in the Glances UI: +The ``dropbox status`` command line will be executed and displayed in +the Glances UI: .. image:: ../_static/amp-dropbox.png -You can force Glances to display the result in one line setting the *one_line* to true. - -Embeded AMP ------------ +You can force Glances to display the result in one line setting +``one_line`` to true. -Glances provides some specifics AMP scripts (replacing the *command* line) hosted -in the glances/amps folder. You can write your own AMP script to fill yours needs. -AMP scripts are located in the glances/amps folder and should be names glances_*.py. -An AMP script define an Amp class (GlancesAmp) with a mandatory update method. -The update method call the set_result method to set the AMP return string. -The return string is a string with one or more line (\n between lines). +Embedded AMP +------------ -You can write your owns AMP and enable its from the configuration file. -The configuration file section should be named [amp_*]. +Glances provides some specific AMP scripts (replacing the ``command`` +line). You can write your own AMP script to fill your needs. AMP scripts +are located in the ``amps`` folder and should be named ``glances_*.py``. +An AMP script define an Amp class (``GlancesAmp``) with a mandatory +update method. The update method call the ``set_result`` method to set +the AMP return string. The return string is a string with one or more +line (\n between lines). To enable it, the configuration file section +should be named ``[amp_*]``. -For example, if you want to enable the Nginx AMP, the following definition -should do the job (NGinx AMP is provided by the Glances team as an example): +For example, if you want to enable the Nginx AMP, the following +definition should do the job (Nginx AMP is provided by the Glances team +as an example): .. code-block:: ini @@ -94,7 +101,7 @@ should do the job (NGinx AMP is provided by the Glances team as an example): one_line=false status_url=http://localhost/nginx_status -Here is the result: +Here's the result: .. image:: ../_static/amps.png |