summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.rst13
-rw-r--r--docs/glances-doc.rst24
-rw-r--r--glances/outputs/glances_curses.py27
3 files changed, 46 insertions, 18 deletions
diff --git a/README.rst b/README.rst
index 2e1f5723..ac3cb74f 100644
--- a/README.rst
+++ b/README.rst
@@ -1,7 +1,5 @@
Follow Glances on Twitter: `@nicolargo`_ or `@glances_system`_
-Give Glances some Bitcoin: `18Nbs6kg9UCqtX4RPDM3qMkeKwjDxBFYrW`_
-
===============================
Glances - An eye on your system
===============================
@@ -39,6 +37,7 @@ Optional dependencies:
- ``hddtemp`` (for HDD temperature monitoring support) [Linux-only]
- ``batinfo`` (for battery monitoring support) [Linux-only]
- ``pysnmp`` (for SNMP support)
+- ``zeroconf`` and ``netifaces`` (for the autodiscovered support)
Installation
============
@@ -46,7 +45,7 @@ Installation
Glances Auto Install script
---------------------------
-Just enter the following command line:
+To install both dependacies and latest Glances version, just enter the following command line:
.. code-block:: console
@@ -193,6 +192,13 @@ on the server side and run:
on the client one.
+You can also detect and display all the Glances servers available on your network:
+
+.. code-block:: console
+
+ $ glances --autodiscover
+
+
And RTFM, always.
Documentation
@@ -216,7 +222,6 @@ LGPL. See ``COPYING`` for more details.
.. _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
.. _PyPI: https://pypi.python.org/pypi
.. _pip: http://www.pip-installer.org/
.. _Homebrew: http://brew.sh/
diff --git a/docs/glances-doc.rst b/docs/glances-doc.rst
index 7cd2491e..38105180 100644
--- a/docs/glances-doc.rst
+++ b/docs/glances-doc.rst
@@ -67,6 +67,12 @@ and on the client:
where ``@server`` is the IP address or hostname of the server.
+Glances can detect and display all Glances servers available on you network using the Zeroconf protocol:
+
+.. code-block:: console
+
+ client$ glances --autodiscover
+
In server mode, you can set the bind address ``-B ADDRESS`` and listening
TCP port ``-p PORT``.
@@ -141,6 +147,7 @@ Command-Line Options
enable extended stats on top process
--output-csv OUTPUT_CSV
export stats to a CSV file
+ --autodiscover run the Glances client browser (list of Glances server)
-c CLIENT, --client CLIENT
connect to a Glances server by IPv4/IPv6 address or
hostname
@@ -152,6 +159,8 @@ Command-Line Options
define password from the command line
--password define a client/server password from the prompt or
file
+ --disable-autodiscover
+ Hide Glances server from the auto discover feature
--snmp-community SNMP_COMMUNITY
SNMP community
--snmp-port SNMP_PORT
@@ -216,8 +225,8 @@ The following commands (key pressed) are supported while in Glances:
Show/hide network stats
``p``
Sort processes by name
-``q``
- Quit
+``q`` or ``ESC``
+ Quit the current Glances session
``r``
Reset history
``s``
@@ -239,6 +248,17 @@ The following commands (key pressed) are supported while in Glances:
``/``
Switch between short name / command line (processes name)
+In the Glances client browser (accessible through the --autodiscover command line argument):
+
+``ENTER``
+ Run Glances client to the selected server
+``UP``
+ Up in the servers list
+``DOWN``
+ Down in the servers list
+``q`` or ``ESC``
+ Quit Glances
+
Configuration
=============
diff --git a/glances/outputs/glances_curses.py b/glances/outputs/glances_curses.py
index a7251c89..523f7f64 100644
--- a/glances/outputs/glances_curses.py
+++ b/glances/outputs/glances_curses.py
@@ -967,6 +967,7 @@ class GlancesCursesBrowser(_GlancesCurses):
['cpu_percent', _('CPU%'), 5],
['mem_percent', _('MEM%'), 5],
['ip', _('IP'), 15],
+ ['port', _('PORT'), 5],
['hr_name', _('OS'), 16],
]
y = 2
@@ -975,11 +976,12 @@ class GlancesCursesBrowser(_GlancesCurses):
cpt = 0
xc = x + 2
for c in column_def:
- self.term_window.addnstr(y, xc,
- c[1],
- screen_x - x,
- self.colors_list['BOLD'])
- xc += c[2] + self.space_between_column
+ if xc < screen_x and y < screen_y:
+ self.term_window.addnstr(y, xc,
+ c[1],
+ screen_x - x,
+ self.colors_list['BOLD'])
+ xc += c[2] + self.space_between_column
cpt += 1
y += 1
@@ -1011,17 +1013,18 @@ class GlancesCursesBrowser(_GlancesCurses):
# Display cursor
self.term_window.addnstr(y, xc,
">",
- screen_x - x,
+ screen_x - xc,
self.colors_list['BOLD'])
xc += 2
for c in column_def:
- # Display server stats
- self.term_window.addnstr(y, xc,
- "%s" % server_stat[c[0]],
- screen_x - x,
- self.colors_list['DEFAULT'])
- xc += c[2] + self.space_between_column
+ if xc < screen_x and y < screen_y:
+ # Display server stats
+ self.term_window.addnstr(y, xc,
+ "%s" % server_stat[c[0]],
+ screen_x - xc,
+ self.colors_list['DEFAULT'])
+ xc += c[2] + self.space_between_column
cpt += 1
# Next line, next server...
y += 1