Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Mar 26, 2016
2 parents ff30e5c + 11659ac commit 0bb34a8
Show file tree
Hide file tree
Showing 35 changed files with 993 additions and 698 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ Frederic Aoustin (https://github.com/fraoustin) and Nicolas Bourges (installer)

Aljaž Srebrnič for the MacPorts package
http://www.macports.org/ports.php?by=name&substr=glances

John Kirkham for the conda package (at conda-forge)
https://github.com/conda-forge/glances-feedstock
14 changes: 14 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
Glances Version 2
==============================================================================

Version 2.6.1
=============

Enhancements and new features:

* Add a connector to Riemann (issue #822 by Greogo Nagy)

Bugs corrected:

* Browsing for servers which are in the [serverlist] is broken (issue #819)
* [WebUI] Glances will not get past loading screen (issue #815) opened 9 days ago
* Python error after upgrading from 2.5.1 to 2.6 bug (issue #813)

Version 2.6
===========

Expand Down Expand Up @@ -34,6 +47,7 @@ Enhancements and new features:
* InfluxDB > 0.9.3 needs float and not int for numerical value (issue#749 and issue#750 by nicolargo)

Bugs corrected:

* Can't read sensors on a Thinkpad (issue #711)
* InfluxDB/OpenTSDB: tag parsing broken (issue #713)
* Grafana Dashboard outdated for InfluxDB 0.9.x (issue #648)
Expand Down
23 changes: 22 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Optional dependencies:
- ``docker-py`` (for the Docker monitoring support) [Linux-only]
- ``matplotlib`` (for graphical/chart support)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)
- ``bernhard`` (for the Riemann export module)
- ``py-cpuinfo`` (for the Quicklook CPU info module)
- ``scandir`` (for the Folders plugin) [Only for Python < 3.5]

Expand Down Expand Up @@ -223,6 +224,26 @@ Puppet

You can install Glances using ``Puppet``: https://github.com/rverchere/puppet-glances

Known issue on RHEL/CentOS/Fedora installation
==============================================

For Python 2.6 RedHat-based distros there might be an issue with starting Glances:

Traceback (most recent call last):
File "/usr/bin/glances", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
workingset.require(_requires)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: argparse

Try upgrading setuptools, has been proven to solve the problem:

sudo pip install -U setuptools

Usage
=====

Expand Down Expand Up @@ -274,7 +295,7 @@ Gateway to other services
=========================

Glances can export stats to: ``CSV`` file, ``InfluxDB``, ``OpenTSDB``,
``StatsD`` and ``RabbitMQ`` server.
``StatsD``, ``RabbitMQ`` and ``Riemann`` server.

How to contribute ?
===================
Expand Down
15 changes: 11 additions & 4 deletions conf/glances.conf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ mem_critical=90
#default=defaultpassword

[influxdb]
# Configuration file for the --export-influxdb option
# Configuration for the --export-influxdb option
# https://influxdb.com/
host=localhost
port=8086
Expand All @@ -209,31 +209,38 @@ prefix=localhost
#tags=foo:bar,spam:eggs

[opentsdb]
# Configuration file for the --export-opentsdb option
# Configuration for the --export-opentsdb option
# http://opentsdb.net/
host=localhost
port=4242
#prefix=glances
#tags=foo:bar,spam:eggs

[statsd]
# Configuration file for the --export-statsd option
# Configuration file the --export-statsd option
# https://github.com/etsy/statsd
host=localhost
port=8125
#prefix=glances

[elasticsearch]
# Configuration file for the --export-elasticsearch option
# Configuration file the --export-elasticsearch option
# Data are available via the ES Restful API. ex: URL/<index>/cpu/system
# https://www.elastic.co
host=localhost
port=9200
index=glances

[riemann]
# Configuration file for the --export-riemann option
# http://riemann.io
host=localhost
port=5555

[rabbitmq]
host=localhost
port=5672
user=guest
password=guest
queue=glances_queue

4 changes: 4 additions & 0 deletions docs/cmds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ Command-Line Options

export stats to RabbitMQ broker (pika lib needed)

.. option:: --export-riemann

export stats to Riemann server (bernhard lib needed)

.. option:: --export-elasticsearch

export stats to an Elasticsearch server (elasticsearch lib needed)
Expand Down
20 changes: 20 additions & 0 deletions docs/gw/riemann.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. _riemann:

Riemann
========

You can export statistics to an ``Riemann`` server (using TCP protocol). The
connection should be defined in the Glances configuration file as
following:

.. code-block:: ini
[riemann]
host=localhost
port=5555
and run Glances with:

.. code-block:: console
$ glances --export-riemann
7 changes: 6 additions & 1 deletion docs/man/glances.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "GLANCES" "1" "March 16, 2016" "2.6" "Glances"
.TH "GLANCES" "1" "March 26, 2016" "2.6.1" "Glances"
.SH NAME
glances \- An eye on your system
.
Expand Down Expand Up @@ -214,6 +214,11 @@ export stats to RabbitMQ broker (pika lib needed)
.UNINDENT
.INDENT 0.0
.TP
.B \-\-export\-riemann
export stats to Riemann server (bernhard lib needed)
.UNINDENT
.INDENT 0.0
.TP
.B \-\-export\-elasticsearch
export stats to an Elasticsearch server (elasticsearch lib needed)
.UNINDENT
Expand Down
10 changes: 5 additions & 5 deletions glances/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

# Global name
__appname__ = 'glances'
__version__ = '2.6'
__version__ = '2.6.1'
__author__ = 'Nicolas Hennion <nicolas@nicolargo.com>'
__license__ = 'LGPL'

# Import psutil
try:
from psutil import __version__ as __psutil_version
from psutil import __version__ as psutil_version
except ImportError:
print('PSutil library not found. Glances cannot start.')
sys.exit(1)
Expand Down Expand Up @@ -62,8 +62,8 @@

# Check PSutil version
psutil_min_version = (2, 0, 0)
psutil_version = tuple([int(num) for num in __psutil_version.split('.')])
if psutil_version < psutil_min_version:
psutil_version_info = tuple([int(num) for num in psutil_version.split('.')])
if psutil_version_info < psutil_min_version:
print('PSutil 2.0 or higher is needed. Glances cannot start.')
sys.exit(1)

Expand Down Expand Up @@ -107,7 +107,7 @@ def main():
logger.info('{0} {1} and PSutil {2} detected'.format(
platform.python_implementation(),
platform.python_version(),
__psutil_version))
psutil_version))

# Share global var
global core, standalone, client, server, webserver
Expand Down
5 changes: 3 additions & 2 deletions glances/autodiscover.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import socket
import sys

from glances.globals import appname, BSD
from glances import __appname__
from glances.globals import BSD
from glances.logger import logger

try:
Expand All @@ -46,7 +47,7 @@
sys.exit(1)

# Global var
zeroconf_type = "_%s._tcp." % appname
zeroconf_type = "_%s._tcp." % __appname__


class AutoDiscovered(object):
Expand Down
10 changes: 5 additions & 5 deletions glances/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import socket
import sys

from glances import __version__
from glances.compat import Fault, ProtocolError, ServerProxy, Transport
from glances.globals import version
from glances.logger import logger
from glances.stats import GlancesStatsClient
from glances.stats_client import GlancesStatsClient
from glances.outputs.glances_curses import GlancesCursesClient


Expand Down Expand Up @@ -122,11 +122,11 @@ def login(self):

if self.client_mode == 'glances':
# Check that both client and server are in the same major version
if version.split('.')[0] == client_version.split('.')[0]:
if __version__.split('.')[0] == client_version.split('.')[0]:
# Init stats
self.stats = GlancesStatsClient(config=self.config, args=self.args)
self.stats.set_plugins(json.loads(self.client.getAllPlugins()))
logger.debug("Client version: {0} / Server version: {1}".format(version, client_version))
logger.debug("Client version: {0} / Server version: {1}".format(__version__, client_version))
else:
self.log_and_exit("Client and server not compatible: \
Client version: {0} / Server version: {1}".format(version, client_version))
Expand All @@ -139,7 +139,7 @@ def login(self):
if self.client_mode == 'snmp':
logger.info("Trying to grab stats by SNMP...")

from glances.stats import GlancesStatsClientSNMP
from glances.stats_client_snmp import GlancesStatsClientSNMP

# Init stats
self.stats = GlancesStatsClientSNMP(config=self.config, args=self.args)
Expand Down
6 changes: 3 additions & 3 deletions glances/client_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
# Copyright (C) 2016 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
Expand All @@ -28,7 +28,7 @@
from glances.logger import logger
from glances.password_list import GlancesPasswordList as GlancesPassword
from glances.static_list import GlancesStaticServer
from glances.outputs.glances_curses import GlancesCursesBrowser
from glances.outputs.glances_curses_browser import GlancesCursesBrowser


class GlancesClientBrowser(object):
Expand Down Expand Up @@ -160,7 +160,7 @@ def __serve_forever(self):
"Server list dictionnary change inside the loop (wait next update)")

# Update the screen (list or Glances client)
if not self.screen.active_server:
if self.screen.active_server is None:
# Display the Glances browser
self.screen.update(self.get_servers_list())
else:
Expand Down
15 changes: 8 additions & 7 deletions glances/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
import sys
from io import open

from glances import __appname__
from glances.compat import ConfigParser, NoOptionError
from glances.globals import appname, BSD, LINUX, OSX, WINDOWS, sys_prefix
from glances.globals import BSD, LINUX, OSX, WINDOWS, sys_prefix
from glances.logger import logger


Expand Down Expand Up @@ -69,22 +70,22 @@ def config_file_paths(self):
paths.append(
os.path.join(os.environ.get('XDG_CONFIG_HOME') or
os.path.expanduser('~/.config'),
appname, self.config_filename))
__appname__, self.config_filename))
if BSD:
paths.append(
os.path.join(sys.prefix, 'etc', appname, self.config_filename))
os.path.join(sys.prefix, 'etc', __appname__, self.config_filename))
else:
paths.append(
os.path.join('/etc', appname, self.config_filename))
os.path.join('/etc', __appname__, self.config_filename))
elif OSX:
paths.append(
os.path.join(os.path.expanduser('~/Library/Application Support/'),
appname, self.config_filename))
__appname__, self.config_filename))
paths.append(
os.path.join(sys_prefix, 'etc', appname, self.config_filename))
os.path.join(sys_prefix, 'etc', __appname__, self.config_filename))
elif WINDOWS:
paths.append(
os.path.join(os.environ.get('APPDATA'), appname, self.config_filename))
os.path.join(os.environ.get('APPDATA'), __appname__, self.config_filename))

return paths

Expand Down

0 comments on commit 0bb34a8

Please sign in to comment.