Skip to content

Instantly share code, notes, and snippets.

@ksingh7
Last active February 5, 2019 10:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksingh7/3e69bef0ffbe4b1b06f95615840f70e6 to your computer and use it in GitHub Desktop.
Save ksingh7/3e69bef0ffbe4b1b06f95615840f70e6 to your computer and use it in GitHub Desktop.
Glances Monitoring Setup
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y glances python-bottle

## You can also open port 61208
systemctl stop firewalld ; systemctl disable firewalld
vim /usr/lib/systemd/system/glancesweb.service
[Unit]
Description = Glances in Web Server Mode
After = network.target

[Service]
ExecStart = /usr/bin/glances -w  -t 2

[Install]
WantedBy = multi-user.target
systemctl status glancesweb.service ; systemctl enable glancesweb.service ; systemctl start glancesweb.service ; systemctl status glancesweb.service
  • Open 61208 port
  • Browser url
@ksingh7
Copy link
Author

ksingh7 commented Nov 25, 2018

  • If glances command throw error like this
[root@r630compute-0 ~]# glances
Traceback (most recent call last):
  File "/bin/glances", line 9, in <module>
    load_entry_point('Glances==2.5.1', 'console_scripts', 'glances')()
  File "/usr/lib/python2.7/site-packages/glances/__init__.py", line 122, in main
    args=core.get_args())
  File "/usr/lib/python2.7/site-packages/glances/core/glances_standalone.py", line 68, in __init__
    self.stats.update()
  File "/usr/lib/python2.7/site-packages/glances/core/glances_stats.py", line 156, in update
    self._plugins[p].update()
  File "/usr/lib/python2.7/site-packages/glances/plugins/glances_plugin.py", line 654, in wrapper
    ret = fct(*args, **kw)
  File "/usr/lib/python2.7/site-packages/glances/plugins/glances_docker.py", line 152, in update
    self.docker_client = self.connect()
  File "/usr/lib/python2.7/site-packages/glances/plugins/glances_docker.py", line 97, in connect
    ret = docker.Client(base_url='unix://var/run/docker.sock')
AttributeError: 'module' object has no attribute 'Client'
[root@r630compute-0 ~]#
  • solution

yum install -y python-pip
pip install --user 'docker-py==1.7.2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment