summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Hennion <nicolas@nicolargo.com>2014-03-11 19:03:02 +0100
committerNicolas Hennion <nicolas@nicolargo.com>2014-03-11 19:03:02 +0100
commite4fea5ea36a808604b27a2d9fe8897075606eea4 (patch)
tree68ddb4b6182433b87015d02ff1b801e8178b40a6
parent5cfb5c95845284c1e9a4523f53e11c17894061f0 (diff)
parentffa284152304eedc93ba07e01ab338ab656a7adc (diff)
Merge branch 'master' of github.com:nicolargo/glances
-rw-r--r--README.rst42
-rw-r--r--glances/glances.py56
-rw-r--r--man/glances.12
3 files changed, 45 insertions, 55 deletions
diff --git a/README.rst b/README.rst
index bdbcf29c..f1fa6f28 100644
--- a/README.rst
+++ b/README.rst
@@ -14,10 +14,9 @@ Glances - An eye on your system
:target: https://pypi.python.org/pypi/Glances/
:alt: Downloads
.. image:: https://d2weczhvl823v0.cloudfront.net/nicolargo/glances/trend.png
- :target: https://bitdeli.com/nicolargo
+ :target: https://bitdeli.com/nicolargo
.. image:: https://raw.github.com/nicolargo/glances/master/docs/images/glances-white-256.png
:width: 128
- :align: center
**Glances** is a cross-platform curses-based monitoring tool written in Python.
@@ -30,12 +29,15 @@ Requirements
- ``python >= 2.6`` (tested with version 2.6, 2.7, 3.2, 3.3)
- ``psutil >= 0.5.1`` (recommended version >= 1.2.1)
-- ``jinja`` (optional for HTML output)
-- ``pysensors`` (optional for HW monitoring support) [Linux-only]
-- ``hddtemp`` (optional for HDD temperature monitoring support)
-- ``batinfo`` (optional for battery monitoring support) [Linux-only]
- ``setuptools``
+Optional dependencies:
+
+- ``jinja2`` (for HTML output)
+- ``pysensors`` (for HW monitoring support) [Linux-only]
+- ``hddtemp`` (for HDD temperature monitoring support)
+- ``batinfo`` (for battery monitoring support) [Linux-only]
+
Installation
============
@@ -57,19 +59,32 @@ To upgrade Glances to the latest version:
Linux
-----
-At the moment, packages exist for Arch Linux, Gentoo, Fedora/CentOS/RHEL,
-Debian (Sid/Testing) and Ubuntu (13.04+), so you should be able to
-install it using your favorite package manager.
+At the moment, packages exist for the following distributions:
+
+- Arch Linux
+- Debian (Testing/Sid)
+- Fedora/CentOS/RHEL
+- Gentoo
+- Ubuntu (13.04+)
+- Void Linux
+
+So you should be able to install it using your favorite package manager.
FreeBSD
-------
-To install the precompiled binary package:
+To install the binary package:
.. code-block:: console
# pkg_add -r py27-glances
+Using pkgng:
+
+.. code-block:: console
+
+ # pkg install py27-glances
+
To install Glances from ports:
.. code-block:: console
@@ -101,12 +116,11 @@ Windows
-------
Glances proposes a Windows client based on the `colorconsole`_ Python library.
+Glances version < 1.7.2 only works in server mode.
-Glances < 1.7.2 only works in server mode. It will run in server mode automatically.
-
-Thanks to Nicolas Bourges, Glances can be easily installed using a Windows installer:
+Thanks to Nicolas Bourges, a Windows installer is available:
-Glances-1.7.2-win32.msi_ (32-bit, MD5: dba4f6cc9f47b6806ffaeb665c093270)
+- Glances-1.7.2-win32.msi_ (32-bit, MD5: dba4f6cc9f47b6806ffaeb665c093270)
Otherwise, you have to follow these steps:
diff --git a/glances/glances.py b/glances/glances.py
index df0fda3f..ea64b34a 100644
--- a/glances/glances.py
+++ b/glances/glances.py
@@ -4438,6 +4438,9 @@ class GlancesClient():
def client_init(self):
try:
client_version = self.client.init()
+ except socket.error as err:
+ print(_("Couldn't create socket: %s") % err)
+ sys.exit(-1)
except ProtocolError as err:
if str(err).find(" 401 ") > 0:
print(_("Error: Connection to server failed. Bad password."))
@@ -4610,32 +4613,18 @@ def main():
username = "glances"
password = ""
- # Manage args
+ # Manage options/arguments
try:
opts, args = getopt.getopt(sys.argv[1:], "B:bdeymnho:f:t:vsc:p:C:P:zr1",
["bind", "bytepersec", "diskio", "mount",
- "sensors", "hddtemp", "netrate", "help", "output",
- "file", "time", "version", "server",
- "client", "port", "config", "password",
- "nobold", "noproc", "percpu"])
+ "sensors", "hddtemp", "netrate", "help",
+ "output", "file", "time", "version",
+ "server", "client", "port", "config",
+ "password", "nobold", "noproc", "percpu"])
except getopt.GetoptError as err:
- # Print help information and exit:
- if (err.opt == 'P') and ('requires argument' in err.msg):
- print(_("Error: -P flag need an argument (password)"))
- elif (err.opt == 'B') and ('requires argument' in err.msg):
- print(_("Error: -B flag need an argument (bind IP address)"))
- elif (err.opt == 'c') and ('requires argument' in err.msg):
- print(_("Error: -c flag need an argument (server IP address/name)"))
- elif (err.opt == 'p') and ('requires argument' in err.msg):
- print(_("Error: -p flag need an argument (port number)"))
- elif (err.opt == 'o') and ('requires argument' in err.msg):
- print(_("Error: -o flag need an argument (HTML or CSV)"))
- elif (err.opt == 't') and ('requires argument' in err.msg):
- print(_("Error: -t flag need an argument (refresh time)"))
- else:
- print(str(err))
- print
- printSyntax()
+ # Print help information and exit
+ print(str(err))
+ print(_("Try 'glances -h' for more information."))
sys.exit(2)
for opt, arg in opts:
if opt in ("-v", "--version"):
@@ -4661,32 +4650,20 @@ def main():
elif arg.lower() == "csv":
csv_tag = True
else:
- print(_("Error: Unknown output %s" % arg))
+ print(_("Error: Unknown output %s") % arg)
sys.exit(2)
elif opt in ("-e", "--sensors"):
- if is_Linux:
- if not sensors_lib_tag:
- print(_("Error: PySensors library not found"))
- sys.exit(2)
- else:
- sensors_tag = True
- else:
- print(_("Error: Sensors module is only available on Linux"))
- sys.exit(2)
+ sensors_tag = True
elif opt in ("-y", "--hddtemp"):
hddtemp_tag = True
elif opt in ("-f", "--file"):
output_file = arg
output_folder = arg
elif opt in ("-t", "--time"):
- try:
- refresh_time = int(arg)
- except:
- print("Error: Invalid refresh time (%s)" % arg)
- sys.exit(2)
- if (refresh_time < 1):
+ if not (arg.isdigit() and int(arg) > 0):
print(_("Error: Refresh time should be a positive integer"))
sys.exit(2)
+ refresh_time = int(arg)
elif opt in ("-d", "--diskio"):
diskio_tag = False
elif opt in ("-m", "--mount"):
@@ -4729,7 +4706,7 @@ def main():
sys.exit(2)
if conf_file_tag:
print(_("Error: Cannot use both -c and -C flag"))
- print(_(" Limits are set based on the server ones"))
+ print(_("Limits are set based on the server ones"))
sys.exit(2)
if password_prompt:
password = get_password(description=_("Enter the Glances server password"), confirm=False)
@@ -4737,7 +4714,6 @@ def main():
if html_tag:
if not html_lib_tag:
print(_("Error: Need Jinja2 library to export into HTML"))
- print(_("Try to install the python-jinja2 package"))
sys.exit(2)
try:
output_folder
diff --git a/man/glances.1 b/man/glances.1
index 020a40e2..5edaaf45 100644
--- a/man/glances.1
+++ b/man/glances.1
@@ -3,7 +3,7 @@
glances \- A cross-platform curses-based monitoring tool
.SH SYNOPSIS
.B glances
-[\-bdehmnrsvyz1] [\-B bind] [\-c server] [\-C conffile] [\-p port] [\-P password] [--password] [\-t refresh] [\-f file] [\-o output]
+[\-bdehmnrsvyz1] [\-B bind] [\-c server] [\-C conffile] [\-p port] [\-P password] [\-\-password] [\-t refresh] [\-f file] [\-o output]
.SH DESCRIPTION
Glances is a free (LGPL) cross-platform curses-based monitoring tool which aims to present a maximum of information
in a minimum of space, ideally to fit in a classical 80x24 terminal or higher to have additionnal information.