Doc updated. Have to test it with degraded cases

This commit is contained in:
nicolargo 2016-04-24 22:17:39 +02:00
parent 83b098a16c
commit e57eef141a
10 changed files with 52 additions and 15 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ Version 2.7
Enhancements and new features:
* Add Application Monitoring Process plugin (issue #780)
* Improve IP plugin to display public IP address (issue #646)
* CPU additionnal stats monitoring: Context switch, Interrupts... (issue #810)
* [Folders] Differentiate permission issue and non-existence of a directory (issue #828)

BIN
docs/_static/amps.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -32,6 +32,7 @@ Legend:
sensors
ps
monitor
amps
logs
docker
actions

View File

@ -95,6 +95,14 @@ Command-Line Options
disable process module
.. option:: --disable-monitor
disable monitoring process list module
.. option:: --disable-amp
disable application monitoring process module
.. option:: --disable-log
disable log module
@ -291,6 +299,9 @@ The following commands (key pressed) are supported while in Glances:
- If CPU iowait ``>60%``, sort processes by I/O read and write
``A``
Enable/disable Application Monitoring Process
``b``
Switch between bit/s or Byte/s for network I/O

View File

@ -21,6 +21,15 @@
I am your father...
...for all Glances Application Monitoring Processes (AMP).
AMP (Application Monitoring Process)
A Glances AMP is a Python script called (every *refresh* seconds) if:
- the AMP is *enabled* in the Glances configuration file
- a process is running (match the *regex* define in the configuration file)
The script should define a Amp (GlancesAmp) class with, at least, an update method.
The update method should 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).
If the *one_line* var is true then the AMP will be displayed in one line.
"""
from glances.compat import u

View File

@ -17,24 +17,32 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
AMP (Application Monitoring Process)
A Glances AMP is a Python script called (every *refresh* seconds) if:
- the AMP is *enabled* in the Glances configuration file
- a process is running (match the *regex* define in the configuration file)
The script should define a Amp (GlancesAmp) class with, at least, an update method.
The update method should 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).
If the *one_line* var is true then the AMP will be displayed in one line.
"""
"""
Nginx AMP
=========
Monitor the Nginx process using the status page
Monitor the Nginx process using the status page.
Configuration file example:
How to read the stats
---------------------
Active connections Number of all open connections. This doesnt mean number of users.
A single user, for a single pageview can open many concurrent connections to your server.
Server accepts handled requests This shows three values.
First is total accepted connections.
Second is total handled connections. Usually first 2 values are same.
Third value is number of and handles requests. This is usually greater than second value.
Dividing third-value by second-one will give you number of requests per connection handled
by Nginx. In above example, 10993/7368, 1.49 requests per connections.
Reading nginx reads request header
Writing nginx reads request body, processes request, or writes response to a client
Waiting keep-alive connections, actually it is active (reading + writing).
This value depends on keepalive-timeout. Do not confuse non-zero waiting value for poor
performance. It can be ignored.
Source (https://easyengine.io/tutorials/nginx/status-page/)
Configuration file example
--------------------------
[nginx]
# Nginx status page should be enable (https://easyengine.io/tutorials/nginx/status-page/)

View File

@ -138,6 +138,10 @@ Start the client browser (browser mode):\n\
help='disable network, disk I/O, FS and sensors modules')
parser.add_argument('--disable-process', action='store_true', default=False,
dest='disable_process', help='disable process module')
parser.add_argument('--disable-monitoring', action='store_true', default=False,
dest='disable_monitor', help='disable monitoring list module')
parser.add_argument('--disable-amp', action='store_true', default=False,
dest='disable_amp', help='disable applications monitoring process (AMP) module')
parser.add_argument('--disable-log', action='store_true', default=False,
dest='disable_log', help='disable log module')
parser.add_argument('--disable-bold', action='store_true', default=False,

View File

@ -328,6 +328,9 @@ class _GlancesCurses(object):
# 'a' > Sort processes automatically and reset to 'cpu_percent'
glances_processes.auto_sort = True
glances_processes.sort_key = 'cpu_percent'
elif self.pressedkey == ord('A'):
# 'A' > enable/disable AMP module
self.args.disable_amp = not self.args.disable_amp
elif self.pressedkey == ord('b'):
# 'b' > Switch between bit/s and Byte/s for network IO
self.args.byte = not self.args.byte

View File

@ -73,7 +73,7 @@ class Plugin(GlancesPlugin):
# Only process if stats exist and display plugin enable...
ret = []
if not self.stats or args.disable_process:
if not self.stats or args.disable_process or args.disable_amp:
return ret
# Build the string message

View File

@ -88,7 +88,7 @@ class Plugin(GlancesPlugin):
ret = []
# Only process if stats exist and display plugin enable...
if not self.stats or args.disable_process:
if not self.stats or args.disable_process or args.disable_monitor:
return ret
# Build the string message