diff options
author | nicolargo <nicolashennion@gmail.com> | 2016-05-02 10:32:46 +0200 |
---|---|---|
committer | nicolargo <nicolashennion@gmail.com> | 2016-05-02 10:32:46 +0200 |
commit | 9c609ffdfdf751200c20e076374c38adf03ecbe0 (patch) | |
tree | 94eb85cb4fbcb75d087e215f4c55f887b5fe104b /docs | |
parent | 1621832567ff096b7407626b27f52b6563de3c1c (diff) |
Update doc for AMP
Diffstat (limited to 'docs')
-rw-r--r-- | docs/_static/amp-python-warning.png | bin | 0 -> 9474 bytes | |||
-rw-r--r-- | docs/_static/amp-python.png | bin | 0 -> 9362 bytes | |||
-rw-r--r-- | docs/_static/amps-dropbox.png | bin | 0 -> 29273 bytes | |||
-rw-r--r-- | docs/_static/amps.png | bin | 56944 -> 80498 bytes | |||
-rw-r--r-- | docs/aoa/amps.rst | 101 | ||||
-rw-r--r-- | docs/aoa/monitor.rst | 61 | ||||
-rw-r--r-- | docs/cmds.rst | 6 |
7 files changed, 104 insertions, 64 deletions
diff --git a/docs/_static/amp-python-warning.png b/docs/_static/amp-python-warning.png Binary files differnew file mode 100644 index 00000000..bd991c76 --- /dev/null +++ b/docs/_static/amp-python-warning.png diff --git a/docs/_static/amp-python.png b/docs/_static/amp-python.png Binary files differnew file mode 100644 index 00000000..ab8f2d72 --- /dev/null +++ b/docs/_static/amp-python.png diff --git a/docs/_static/amps-dropbox.png b/docs/_static/amps-dropbox.png Binary files differnew file mode 100644 index 00000000..7a1bcda2 --- /dev/null +++ b/docs/_static/amps-dropbox.png diff --git a/docs/_static/amps.png b/docs/_static/amps.png Binary files differindex bbcc7efe..c165a9c0 100644 --- a/docs/_static/amps.png +++ b/docs/_static/amps.png diff --git a/docs/aoa/amps.rst b/docs/aoa/amps.rst new file mode 100644 index 00000000..bdaf777f --- /dev/null +++ b/docs/aoa/amps.rst @@ -0,0 +1,101 @@ +.. _amps: + +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. + +You can disable AMP using the --disable-amps option or pressing the `A` shortkey. + +Simple AMP +---------- + +For example, a simple AMP which monitor the CPU/MEM of all Python processes +can be define using: + +.. code-block:: ini + + [amp_python] + enable=true + 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: + +.. image:: ../_static/amp-python.png + +You can also define the minimum (*countmin*) and/or maximum (*countmax*) process +number. For example: + +.. code-block:: ini + + [amp_python] + enable=true + regex=.*python.* + refresh=3 + 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): + +.. image:: ../_static/amp-python-warning.png + +User define 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: + +.. code-block:: ini + + [amp_dropbox] + # Use the default AMP (no dedicated AMP Python script) + enable=true + regex=.*dropbox.* + refresh=3 + one_line=false + command=dropbox status + countmin=1 + +The *dropbox status* command line will be executed and displayed in the Glances UI: + +.. image:: ../_static/amp-python-dropbox.png + +You can force Glances to display the result in one line setting the *one_line* to true. + +Embeded AMP +----------- + +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). + +You can write your owns AMP and enable its from the configuration file. +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): + +.. code-block:: ini + + [amp_nginx] + enable=true + regex=\/usr\/sbin\/nginx + refresh=60 + one_line=false + status_url=http://localhost/nginx_status + +Here is the result: + +.. image:: ../_static/amps.png + +In client/server mode, the AMP list is defined on the server side. diff --git a/docs/aoa/monitor.rst b/docs/aoa/monitor.rst index c0bdb3ee..16d81d4d 100644 --- a/docs/aoa/monitor.rst +++ b/docs/aoa/monitor.rst @@ -3,63 +3,6 @@ Monitored Processes List ======================== -The monitored processes list allows user, through the configuration -file, to group processes and quickly show if the number of running -processes is not good. +The monitored processes list is deprecated. -.. image:: ../_static/monitored.png - -Each item is defined by: - -- ``description``: description of the processes (max 16 chars). -- ``regex``: regular expression of the processes to monitor. -- ``command``: (optional) full path to shell command/script for extended -- stat. Should return a single line string. Use with caution. -- ``countmin``: (optional) minimal number of processes. A warning will -- be displayed if number of processes < count. -- ``countmax``: (optional) maximum number of processes. A warning will - be displayed if number of processes > count. - -Up to ``10`` items can be defined. - -For example, if you want to monitor the Nginx processes on a web server, -the following definition should do the job: - -.. code-block:: ini - - [monitor] - list_1_description=Nginx server - list_1_regex=.*nginx.* - list_1_command=nginx -v - list_1_countmin=1 - list_1_countmax=4 - -If you also want to monitor the PHP-FPM daemon processes, you should add -another item: - -.. code-block:: ini - - [monitor] - list_1_description=Nginx server - list_1_regex=.*nginx.* - list_1_command=nginx -v - list_1_countmin=1 - list_1_countmax=4 - list_2_description=PHP-FPM - list_2_regex=.*php-fpm.* - list_2_countmin=1 - list_2_countmax=20 - -In client/server mode, the list is defined on the server side. -A new method, called `getAllMonitored`, is available in the APIs and -get the JSON representation of the monitored processes list. - -Alerts are set as following: - -================= ============ -# of process Status -================= ============ -``0`` ``CRITICAL`` -``min < p < max`` ``OK`` -``p > max`` ``WARNING`` -================= ============ +Please use the Application Monitoring Process (AMP). diff --git a/docs/cmds.rst b/docs/cmds.rst index e67bd974..9078b4ea 100644 --- a/docs/cmds.rst +++ b/docs/cmds.rst @@ -95,11 +95,7 @@ Command-Line Options disable process module -.. option:: --disable-monitor - - disable monitoring process list module - -.. option:: --disable-amp +.. option:: --disable-amps disable application monitoring process module |