summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolargo <nicolas@nicolargo.com>2014-09-13 15:33:04 +0200
committerNicolargo <nicolas@nicolargo.com>2014-09-13 15:33:04 +0200
commit20fbe4f5d5dd10cabf5de893ea90f60d4d637e5b (patch)
tree4a1806a5ba89883e02e242e5ee57c21db4993a83
parent0b61225e3495324979f462fcdef0623bb0804d87 (diff)
parent6e33121b61ed65a1eb1f96878b1c8ba4cf324a03 (diff)
Merge branch 'release/v2.1'v2.1
-rw-r--r--.travis.yml9
-rw-r--r--AUTHORS4
-rw-r--r--NEWS47
-rw-r--r--README.rst16
-rw-r--r--conf/glances-test.conf15
-rw-r--r--conf/glances.conf15
-rw-r--r--docs/glances-doc.html214
-rw-r--r--docs/glances-doc.rst168
-rw-r--r--docs/images/processlist-top.pngbin0 -> 53684 bytes
-rw-r--r--docs/images/screenshot-wide.pngbin398643 -> 437692 bytes
-rw-r--r--docs/images/screenshot.pngbin212944 -> 186560 bytes
-rw-r--r--glances/__init__.py43
-rw-r--r--glances/core/glances_client.py84
-rw-r--r--glances/core/glances_config.py16
-rw-r--r--glances/core/glances_globals.py7
-rw-r--r--glances/core/glances_logging.py83
-rw-r--r--glances/core/glances_logs.py7
-rw-r--r--glances/core/glances_main.py85
-rw-r--r--glances/core/glances_monitor_list.py4
-rw-r--r--glances/core/glances_password.py9
-rw-r--r--glances/core/glances_processes.py430
-rw-r--r--glances/core/glances_server.py7
-rw-r--r--glances/core/glances_snmp.py14
-rw-r--r--glances/core/glances_standalone.py25
-rw-r--r--glances/core/glances_stats.py104
-rw-r--r--glances/outputs/glances_bottle.py162
-rw-r--r--glances/outputs/glances_colorconsole.py4
-rw-r--r--glances/outputs/glances_csv.py9
-rw-r--r--glances/outputs/glances_curses.py381
-rw-r--r--glances/outputs/glances_history.py111
-rw-r--r--glances/outputs/static/css/style.css3
-rw-r--r--glances/plugins/glances_alert.py19
-rw-r--r--glances/plugins/glances_batpercent.py26
-rw-r--r--glances/plugins/glances_cpu.py91
-rw-r--r--glances/plugins/glances_diskio.py16
-rw-r--r--glances/plugins/glances_fs.py88
-rw-r--r--glances/plugins/glances_help.py77
-rw-r--r--glances/plugins/glances_load.py49
-rw-r--r--glances/plugins/glances_mem.py93
-rw-r--r--glances/plugins/glances_memswap.py62
-rw-r--r--glances/plugins/glances_monitor.py11
-rw-r--r--glances/plugins/glances_network.py56
-rw-r--r--glances/plugins/glances_now.py7
-rw-r--r--glances/plugins/glances_percpu.py6
-rw-r--r--glances/plugins/glances_plugin.py217
-rw-r--r--glances/plugins/glances_processcount.py29
-rw-r--r--glances/plugins/glances_processlist.py204
-rw-r--r--glances/plugins/glances_sensors.py42
-rw-r--r--glances/plugins/glances_system.py35
-rw-r--r--glances/plugins/glances_uptime.py8
-rwxr-xr-xi18n-gen.sh8
-rw-r--r--man/glances.147
-rwxr-xr-xsetup.py9
-rwxr-xr-xunitest-restful.py178
-rwxr-xr-xunitest-xmlrpc.py206
55 files changed, 2839 insertions, 821 deletions
diff --git a/.travis.yml b/.travis.yml
index 8cbebe76..715fd5dd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,9 +1,14 @@
language: python
python:
- - "2.6"
- "2.7"
- "3.3"
- "3.4"
+ - "pypy"
install:
- pip install -r requirements.txt
-script: python setup.py install
+ - pip install coveralls
+script:
+ - python setup.py install
+ - coverage run --source=glances unitest.py
+after_success:
+ - coveralls \ No newline at end of file
diff --git a/AUTHORS b/AUTHORS
index b8784100..b08248bc 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -20,8 +20,8 @@ https://github.com/jrenner
Packagers
=========
-Geoffroy Youri Berret for the Debian package
-http://packages.debian.org/fr/sid/glances
+Rémi Verchère for the Debian package
+https://github.com/rverchere/debian-glances
gasol.wu@gmail.com for the FreeBSD port
diff --git a/NEWS b/NEWS
index a1b276ba..0d17adf7 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,49 @@
Glances Version 2.x
==============================================================================
+Version 2.1
+===========
+
+ * Add user process filter feature
+ User can define a process filter pattern (as a regular expression).
+ The pattern could be defined from the command line (-f <pattern>)
+ or by pressing the ENTER key in the curse interface.
+ For the moment, process filter feature is only available in standalone mode.
+ * Add extended processes informations for top process
+ Top process stats availables: CPU affinity, extended memory information (shared, text, lib, datat, dirty, swap), openned threads/files and TCP/UDP network sessions, IO nice level
+ For the moment, extended processes stats are only available in standalone mode.
+ * Add --process-short-name tag and '/' key to switch between short/command line
+ * Create a max_processes key in the configuration file
+ The goal is to reduce the number of displayed processes in the curses UI and
+ so limit the CPU footprint of the Glances standalone mode.
+ The API always return all the processes, the key is only active in the curses UI.
+ If the key is not define, all the processes will be displayed.
+ The default value is 20 (processes displayed).
+ For the moment, this feature is only available in standalone mode.
+ * Alias for network interfaces, disks and sensors
+ Users can configure alias from the Glances configuration file.
+ * Add Glances log message (in the /tmp/glances.log file)
+ The default log level is INFO, you can switch to the DEBUG mode using the -d option on the command line.
+ * Add RESTFul API to the Web server mode
+ RestFul API doc: https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
+ * Improve SNMP fallback mode for Cisco IOS, VMware ESXi
+ * Add --theme-white feature to optimize display for white background
+ * Experimental history feature (--enable-history option on the command line)
+ This feature allows users to generate graphs within the curse interface.
+ Graphs are available for CPU, LOAD and MEM.
+ To generate graph, click on the 'g' key.
+ To reset the history, press the 'r' key.
+ Note: This feature uses the matplotlib library.
+ * CI: Improve Travis coverage
+
+Bugs corrected:
+
+ * Quitting glances leaves a column layout to the current terminal (issue #392)
+ * Glances crashes with malformed UTF-8 sequences in process command lines (issue #391)
+ * SNMP fallback mode is not Python 3 compliant (issue #386)
+ * Trouble using batinfo, hddtemp, pysensors w/ Python (issue #324)
+
+
Version 2.0.1
=============
@@ -325,13 +368,13 @@ Version 1.3
===========
* Add file system stats (total and used space)
- * Adapt unit dynamicaly (K, M, G)
+ * Adapt unit dynamically (K, M, G)
* Add man page (Thanks to Edouard Bourguignon)
Version 1.2
===========
- * Resize the terminal and the windows are adapted dynamicaly
+ * Resize the terminal and the windows are adapted dynamically
* Refresh screen instantanetly when a key is pressed
Version 1.1.3
diff --git a/README.rst b/README.rst
index f57edb1c..2e1f5723 100644
--- a/README.rst
+++ b/README.rst
@@ -43,6 +43,18 @@ Optional dependencies:
Installation
============
+Glances Auto Install script
+---------------------------
+
+Just enter the following command line:
+
+.. code-block:: console
+
+ curl -L http://bit.ly/glances | /bin/bash
+
+*Note*: Only supported on some GNU/Linux distributions.
+If you want to support others distribs, please contribute to `glancesautoinstall`_.
+
PyPI: The simple way
--------------------
@@ -188,6 +200,8 @@ Documentation
For complete documentation see `glances-doc`_.
+If you have any question (after RTFM !), please post it on the official Q&A `forum`_.
+
Author
======
@@ -199,6 +213,7 @@ License
LGPL. See ``COPYING`` for more details.
.. _psutil: https://code.google.com/p/psutil/
+.. _glancesautoinstall: https://github.com/nicolargo/glancesautoinstall
.. _@nicolargo: https://twitter.com/nicolargo
.. _@glances_system: https://twitter.com/glances_system
.. _18Nbs6kg9UCqtX4RPDM3qMkeKwjDxBFYrW: bitcoin:18Nbs6kg9UCqtX4RPDM3qMkeKwjDxBFYrW?amount=1X8&label=Glances
@@ -209,3 +224,4 @@ LGPL. See ``COPYING`` for more details.
.. _colorconsole: https://pypi.python.org/pypi/colorconsole
.. _Puppet: https://puppetlabs.com/puppet/what-is-puppet/
.. _glances-doc: https://github.com/nicolargo/glances/blob/master/docs/glances-doc.rst
+.. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users
diff --git a/conf/glances-test.conf b/conf/glances-test.conf
index 450e6810..fef896ec 100644
--- a/conf/glances-test.conf
+++ b/conf/glances-test.conf
@@ -51,7 +51,9 @@ critical=90
[network]
# Define the list of hidden network interfaces (comma separeted)
hide=lo
-# Default limits (in bits per second aka bps) for interface bitrate
+# WLAN0 alias name
+wlan0_alias=Wireless
+# WLAN0 Default limits (in bits per second aka bps) for interface bitrate
wlan0_rx_careful=4000000
wlan0_rx_warning=5000000
wlan0_rx_critical=6000000
@@ -62,6 +64,8 @@ wlan0_tx_critical=1000000
[diskio]
# Define the list of hidden disks (comma separeted)
hide=sda2,sda5
+# Alias for sda1
+#sda1_alias=IntDisk
[fs]
# Default limits for free filesytem space in %
@@ -85,8 +89,17 @@ temperature_hdd_critical=60
battery_careful=80
battery_warning=90
battery_critical=95
+# Sensors alias
+temp1_alias=Motherboard 0
+temp2_alias=Motherboard 1
+core 0_alias=CPU Core 0
+core 1_alias=CPU Core 1
[processlist]
+# Maximum number of processes to show in the UI
+# Note: Only limit number of showed processes (not the one returned by the API)
+# Default is 20 processes (Top 20)
+max_processes=20
# Limit values for CPU/MEM per process in %
# Default values if not defined: 50/70/90
cpu_careful=50
diff --git a/conf/glances.conf b/conf/glances.conf
index 81155b31..c0dbb077 100644
--- a/conf/glances.conf
+++ b/conf/glances.conf
@@ -51,7 +51,9 @@ critical=90
#[network]
# Define the list of hidden network interfaces (comma separeted)
#hide=lo
-# Default limits (in bits per second aka bps) for interface bitrate
+# WLAN 0 alias
+#wlan0_alias=Wireless IF
+# WLAN 0 Default limits (in bits per second aka bps) for interface bitrate
#wlan0_rx_careful=4000000
#wlan0_rx_warning=5000000
#wlan0_rx_critical=6000000
@@ -62,6 +64,8 @@ critical=90
#[diskio]
# Define the list of hidden disks (comma separeted)
#hide=sda2,sda5
+# Alias for sda1
+#sda1_alias=IntDisk
[fs]
# Default limits for free filesytem space in %
@@ -85,8 +89,17 @@ temperature_hdd_critical=60
battery_careful=80
battery_warning=90
battery_critical=95
+# Sensors alias
+#temp1_alias=Motherboard 0
+#temp2_alias=Motherboard 1
+#core 0_alias=CPU Core 0
+#core 1_alias=CPU Core 1
[processlist]
+# Maximum number of processes to show in the UI
+# Note: Only limit number of showed processes (not the one returned by the API)
+# Default is 20 processes (Top 20)
+max_processes=20
# Limit values for CPU/MEM per process in %
# Default values if not defined: 50/70/90
cpu_careful=50
diff --git a/docs/glances-doc.html b/docs/glances-doc.html
index 1f044548..32501916 100644
--- a/docs/glances-doc.html
+++ b/docs/glances-doc.html
@@ -123,9 +123,9 @@ td.option-group {
<div class="document" id="glances">
<h1 class="title">Glances</h1>
-<p>This manual describes <em>Glances</em> version 2.0.1.</p>
+<p>This manual describes <em>Glances</em> version 2.1.</p>
<p>Copyright © 2012-2014 Nicolas Hennion &lt;<a class="reference external" href="mailto:nicolas&#64;nicolargo.com">nicolas&#64;nicolargo.com</a>&gt;</p>
-<p>June 2014</p>
+<p>September 2014</p>
<div class="contents topic" id="table-of-contents">
<p class="topic-title first">Table of Contents</p>
<ul class="simple">
@@ -142,24 +142,25 @@ td.option-group {
</ul>
</li>
<li><a class="reference internal" href="#configuration" id="id13">Configuration</a></li>
-<li><a class="reference internal" href="#anatomy-of-the-application" id="id14">Anatomy Of The Application</a><ul>
-<li><a class="reference internal" href="#legend" id="id15">Legend</a></li>
-<li><a class="reference internal" href="#header" id="id16">Header</a></li>
-<li><a class="reference internal" href="#cpu" id="id17">CPU</a></li>
-<li><a class="reference internal" href="#load" id="id18">Load</a></li>
-<li><a class="reference internal" href="#memory" id="id19">Memory</a></li>
-<li><a class="reference internal" href="#network" id="id20">Network</a></li>
-<li><a class="reference internal" href="#disk-i-o" id="id21">Disk I/O</a></li>
-<li><a class="reference internal" href="#file-system" id="id22">File System</a></li>
-<li><a class="reference internal" href="#sensors" id="id23">Sensors</a></li>
-<li><a class="reference internal" href="#processes-list" id="id24">Processes List</a></li>
-<li><a class="reference internal" href="#monitored-processes-list" id="id25">Monitored Processes List</a></li>
-<li><a class="reference internal" href="#logs" id="id26">Logs</a></li>
+<li><a class="reference internal" href="#logs-and-debug-mode" id="id14">Logs and debug mode</a></li>
+<li><a class="reference internal" href="#anatomy-of-the-application" id="id15">Anatomy Of The Application</a><ul>
+<li><a class="reference internal" href="#legend" id="id16">Legend</a></li>
+<li><a class="reference internal" href="#header" id="id17">Header</a></li>
+<li><a class="reference internal" href="#cpu" id="id18">CPU</a></li>
+<li><a class="reference internal" href="#load" id="id19">Load</a></li>
+<li><a class="reference internal" href="#memory" id="id20">Memory</a></li>
+<li><a class="reference internal" href="#network" id="id21">Network</a></li>
+<li><a class="reference internal" href="#disk-i-o" id="id22">Disk I/O</a></li>
+<li><a class="reference internal" href="#file-system" id="id23">File System</a></li>
+<li><a class="reference internal" href="#sensors" id="id24">Sensors</a></li>
+<li><a class="reference internal" href="#processes-list" id="id25">Processes List</a></li>
+<li><a class="reference internal" href="#monitored-processes-list" id="id26">Monitored Processes List</a></li>
+<li><a class="reference internal" href="#logs" id="id27">Logs</a></li>
</ul>
</li>
-<li><a class="reference internal" href="#other-outputs" id="id27">Other Outputs</a></li>
-<li><a class="reference internal" href="#api-documentation" id="id28">API Documentation</a></li>
-<li><a class="reference internal" href="#support" id="id29">Support</a></li>
+<li><a class="reference internal" href="#other-outputs" id="id28">Other Outputs</a></li>
+<li><a class="reference internal" href="#apis-documentations" id="id29">APIs Documentations</a></li>
+<li><a class="reference internal" href="#support" id="id30">Support</a></li>
</ul>
</div>
<div class="section" id="introduction">
@@ -206,7 +207,7 @@ TCP port <tt class="docutils literal"><span class="pre">-p</span> PORT</tt>.</p>
<p>In client mode, you can set the TCP port of the server <tt class="docutils literal"><span class="pre">-p</span> PORT</tt>.</p>
<p>You can also set a password to access to the server <tt class="docutils literal"><span class="pre">--password</span></tt>.</p>
<p>Default binding address is <tt class="docutils literal">0.0.0.0</tt> (Glances will listen on all the
-network interfaces) and TCP port is <tt class="docutils literal">61209</tt>.</p>
+available network interfaces) and TCP port is <tt class="docutils literal">61209</tt>.</p>
<p>In client/server mode, limits are set by the server side.</p>
<p>Glances is <tt class="docutils literal">IPv6</tt> compatible. Just use the <tt class="docutils literal"><span class="pre">-B</span> ::</tt> option to bind to
all IPv6 addresses.</p>
@@ -215,13 +216,12 @@ client, the latter will try to grab stats using the <tt class="docutils literal"
<pre class="code console literal-block">
<span class="generic output">client$ glances -c &#64;snmpserver</span>
</pre>
-<p>Known issues: grab using SNMP is only validated for GNU/Linux with SNMP
-v2/2c server.</p>
+<p>Note: Stats grabbed by SNMP request are limited.</p>
</div>
<div class="section" id="web-server-mode">
<h2><a class="toc-backref" href="#id9">Web Server Mode</a></h2>
<p>If you want to remotely monitor a machine, called <tt class="docutils literal">server</tt>, from any
-device with a web browser, called <tt class="docutils literal">client</tt>, just run on the server:</p>
+device with a web browser, just run on the server:</p>
<pre class="code console literal-block">
<span class="generic output">server$ glances -w</span>
</pre>
@@ -239,6 +239,7 @@ http://&#64;server:61208
<h1><a class="toc-backref" href="#id10">Command Reference</a></h1>
<div class="section" id="command-line-options">
<h2><a class="toc-backref" href="#id11">Command-Line Options</a></h2>
+<blockquote>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
@@ -250,21 +251,16 @@ http://&#64;server:61208
<kbd><span class="option">-V</span>, <span class="option">--version</span></kbd></td>
<td>show program's version number and exit</td></tr>
<tr><td class="option-group">
-<kbd><span class="option">-b</span>, <span class="option">--byte</span></kbd></td>
-<td>display network rate in byte per second</td></tr>
-<tr><td class="option-group" colspan="2">
-<kbd><span class="option">-B <var>BIND_ADDRESS</var></span>, <span class="option">--bind <var>BIND_ADDRESS</var></span></kbd></td>
-</tr>
-<tr><td>&nbsp;</td><td>bind server to the given IPv4/IPv6 address or hostname</td></tr>
-<tr><td class="option-group" colspan="2">
-<kbd><span class="option">-c <var>CLIENT</var></span>, <span class="option">--client <var>CLIENT</var></span></kbd></td>
-</tr>
-<tr><td>&nbsp;</td><td>connect to a Glances server by IPv4/IPv6 address or
-hostname</td></tr>
+<kbd><span class="option">-d</span>, <span class="option">--debug</span></kbd></td>
+<td>Enable debug mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-C <var>CONF_FILE</var></span>, <span class="option">--config <var>CONF_FILE</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>path to the configuration file</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--enable-history</span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>enable the history mode</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--disable-bold</span></kbd></td>
<td>disable bold mode in the terminal</td></tr>
@@ -274,7 +270,7 @@ hostname</td></tr>
<tr><td>&nbsp;</td><td>disable disk I/O module</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--disable-fs</span></kbd></td>
-<td>disable file system module</td></tr>
+<td>disable filesystem module</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--disable-network</span></kbd></td>
</tr>
@@ -287,6 +283,10 @@ hostname</td></tr>
<kbd><span class="option">--disable-process</span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>disable process module</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--disable-process-extended</span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>disable extended stats on top process</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--disable-log</span></kbd></td>
<td>disable log module</td></tr>
@@ -295,16 +295,29 @@ hostname</td></tr>
</tr>
<tr><td>&nbsp;</td><td>export stats to a CSV file</td></tr>
<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-c <var>CLIENT</var></span>, <span class="option">--client <var>CLIENT</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>connect to a Glances server by IPv4/IPv6 address or
+hostname</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-s</span>, <span class="option">--server</span></kbd></td>
+<td>run Glances in server mode</td></tr>
+<tr><td class="option-group" colspan="2">
<kbd><span class="option">-p <var>PORT</var></span>, <span class="option">--port <var>PORT</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>define the client/server TCP port [default: 61209]</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-B <var>BIND_ADDRESS</var></span>, <span class="option">--bind <var>BIND_ADDRESS</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>bind server to the given IPv4/IPv6 address or hostname</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--password-badidea <var>PASSWORD_ARG</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>define password from the command line</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--password</span></kbd></td>
<td>define a client/server password from the prompt or
file</td></tr>
-<tr><td class="option-group">
-<kbd><span class="option">-s</span>, <span class="option">--server</span></kbd></td>
-<td>run Glances in server mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--snmp-community <var>SNMP_COMMUNITY</var></span></kbd></td>
</tr>
@@ -325,6 +338,9 @@ file</td></tr>
<kbd><span class="option">--snmp-auth <var>SNMP_AUTH</var></span></kbd></td>
</tr>
<tr><td>&nbsp;</td><td>SNMP authentication key (only for SNMPv3)</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">--snmp-force</span></kbd></td>
+<td>force SNMP mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-t <var>TIME</var></span>, <span class="option">--time <var>TIME</var></span></kbd></td>
</tr>
@@ -332,17 +348,40 @@ file</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-w</span>, <span class="option">--webserver</span></kbd></td>
</tr>
-<tr><td>&nbsp;</td><td>run Glances in Web server mode</td></tr>
+<tr><td>&nbsp;</td><td>run Glances in web server mode</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">-f <var>PROCESS_FILTER</var></span>, <span class="option">--process-filter <var>PROCESS_FILTER</var></span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>set the process filter patern (regular expression)</td></tr>
+<tr><td class="option-group" colspan="2">
+<kbd><span class="option">--process-short-name</span></kbd></td>
+</tr>
+<tr><td>&nbsp;</td><td>force short name for processes name</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">-b</span>, <span class="option">--byte</span></kbd></td>
+<td>display network rate in byte per second</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-1</span>, <span class="option">--percpu</span></kbd></td>
<td>start Glances in per CPU mode</td></tr>
+<tr><td class="option-group">
+<kbd><span class="option">--theme-white</span></kbd>&