GithubHelp home page GithubHelp logo

kadalu / gdash Goto Github PK

View Code? Open in Web Editor NEW
58.0 5.0 16.0 713 KB

Lightweight GlusterFS Dashboard

License: Other

Makefile 1.29% Python 10.80% JavaScript 61.63% CSS 23.83% HTML 2.45%
glusterfs dashboard monitor health

gdash's Introduction

gdash - GlusterFS Dashboard

Install

sudo pip3 install gdash

Usage

Start gdash service in any one of the Gluster server node.

sudo gdash <HOSTNAME>

Provide the hostname to identify where gdash is running. Use the same hostname or IP which is used with Gluster Peer/Volume commands. Gdash will use this to replace the mention of "localhost" in the peer commands.

Protect the dashboard access from others by setting the username and password.

Generate One way hash of Password

$ echo -n "MySecret@01" | sha256sum
1ae946b331052b646ca7d0857dfb205835b2a00a33a35e40b4419a5e150213f3  -

Add that to a file(/etc/glusterfs/gdash.dat) in the following format,

admin=1ae946b331052b646ca7d0857dfb205835b2a00a33a35e40b4419a5e150213f3
aravinda=9e56d42f4be084e5e56c9c23c3917ae10611678743b7f7ca0f6d65c4dd413408

Then run gdash using,

sudo gdash node1.example.com --auth-file=/etc/glusterfs/gdash.dat

Now you can visit http://localhost:8080 (or :8080 if accessing gdash externally) from your browser.

Note: Port can be customized by providing --port option(For example, --port 3000)

Other available options are

$ gdash --help
usage: gdash [-h] [--version] [--port PORT] [--gluster-binary GLUSTER_BINARY]
             [--auth-file AUTH_FILE] [--ssl-cert CERT_FILE] [--ssl-key KEY_FILE] [--ssl-ca CA_CERT_FILE] [--ssl-ciphers LIST_OF_CIPHERS]
             host

gdash - GlusterFS Dashboard

positional arguments:
  host                  Hostname of Current node as used in Gluster peer
                        commands. Gdash replaces the "localhost" references
                        with this name

optional arguments:
  -h, --help                       show this help message and exit
  --version                        show program's version number and exit
  --port PORT                      Gdash Port(Default is 8080)
  --gluster-binary GLUSTER_BINARY  Gluster binary path.
  --auth-file AUTH_FILE            Users Credentials file. One user
                                   entry per row in the
                                   format <username>=<password_hash>
  --ssl-cert CERT_FILE             Path to SSL Certificate file
  --ssl-key KEY_FILE               Path to SSL Key file
  --ssl-ca CA_FILE                 Path to SSL CA Certificate file
  --ssl-ciphers                    List of SSL Ciphers to allow

Blog

Issues

For feature requests, issues, suggestions here

gdash's People

Contributors

aravindavk avatar coderise-ahsan avatar dependabot[bot] avatar gaby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gdash's Issues

Need to bind to actual IP

Localhost doesn't work for me as my cluster is in a data center. How do I bind gdash to an IP instead of localhost?

I have problem to open volumes on my external gluster

When I try to run the gdash for my server I have receive exception when I try to open volumes in UI
In my opinion problem is that xml generated on my machine not include section inodesTotal
'inodes_total': int(node_el.find('inodesTotal').text),

[19/Sep/2021:20:28:17] HTTP
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/glustercli/cli/parsers.py", line 268, in _parse_volume_status
    nodes.append(_parse_a_node(node_el))
  File "/usr/local/lib/python3.8/dist-packages/glustercli/cli/parsers.py", line 237, in _parse_a_node
    'inodes_total': int(node_el.find('inodesTotal').text),
AttributeError: 'NoneType' object has no attribute 'text'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/usr/local/lib/python3.8/dist-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/usr/local/lib/python3.8/dist-packages/cherrypy/lib/encoding.py", line 223, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/dist-packages/gdash/__main__.py", line 99, in volumes
    return volume.status_detail(group_subvols=True)
  File "/usr/local/lib/python3.8/dist-packages/glustercli/cli/volume.py", line 187, in status_detail
    return parse_volume_status(volume_execute_xml(cmd),
  File "/usr/local/lib/python3.8/dist-packages/glustercli/cli/parsers.py", line 276, in parse_volume_status
    nodes_data = _parse_volume_status(status_data)
  File "/usr/local/lib/python3.8/dist-packages/glustercli/cli/parsers.py", line 270, in _parse_volume_status
    raise GlusterCmdOutputParseError(err)
glustercli.cli.parsers.GlusterCmdOutputParseError: 'NoneType' object has no attribute 'text'
[19/Sep/2021:20:28:17] HTTP
Request Headers:
  Remote-Addr: 192.168.10.19
  HOST: glusterfs1:8080
  CONNECTION: keep-alive
  ACCEPT: application/json, text/plain, */*
  USER-AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36
  REFERER: http://glusterfs1:8080/volumes
  ACCEPT-ENCODING: gzip, deflate
  ACCEPT-LANGUAGE: en,pl-PL;q=0.9,pl;q=0.8,en-GB;q=0.7,en-US;q=0.6
  COOKIE: session_id=0b9e47c8ce86c8fdbd11aa1af14a9db7f9f9e03e
192.168.10.19 - - [19/Sep/2021:20:28:17] "GET /api/volumes HTTP/1.1" 500 2754 "http://glusterfs1:8080/volumes" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36"

gluster vol status test-volume detail --xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cliOutput>
  <opRet>0</opRet>
  <opErrno>0</opErrno>
  <opErrstr/>
  <volStatus>
    <volumes>
      <volume>
        <volName>test-volume</volName>
        <nodeCount>2</nodeCount>
        <node>
          <hostname>glusterfs1</hostname>
          <path>/gluster/test</path>
          <peerid>8e119499-ab8d-4715-bace-2f16bfe23293</peerid>
          <status>1</status>
          <port>49159</port>
          <ports>
            <tcp>49159</tcp>
            <rdma>N/A</rdma>
          </ports>
          <pid>6014</pid>
          <sizeTotal>869729808384</sizeTotal>
          <sizeFree>703918551040</sizeFree>
          <device>/dev/sdb1</device>
          <blockSize>4096</blockSize>
          <mntOptions>rw,relatime,compress-force=lzo,space_cache,subvolid=5,subvol=/</mntOptions>
          <fsName>btrfs</fsName>
          <inodeSize>btrfs</inodeSize>
        </node>
        <node>
          <hostname>glusterfs2</hostname>
          <path>/gluster/test</path>
          <peerid>8f5ef325-5a77-473b-8d5f-b2258440ac58</peerid>
          <status>1</status>
          <port>49159</port>
          <ports>
            <tcp>49159</tcp>
            <rdma>N/A</rdma>
          </ports>
          <pid>108320</pid>
          <sizeTotal>869729808384</sizeTotal>
          <sizeFree>714670706688</sizeFree>
          <device>/dev/sdb1</device>
          <blockSize>4096</blockSize>
          <mntOptions>rw,relatime,compress-force=lzo,space_cache,subvolid=5,subvol=/</mntOptions>
          <fsName>btrfs</fsName>
          <inodeSize>btrfs</inodeSize>
        </node>
      </volume>
    </volumes>
  </volStatus>
</cliOutput>

Below is version of installed glusterfs components: apt list --installed | grep gluster

glusterfs-client/focal,now 9.3-ubuntu1~focal1 amd64 [installed]
glusterfs-common/focal,now 9.3-ubuntu1~focal1 amd64 [installed]
glusterfs-server/focal,now 9.3-ubuntu1~focal1 amd64 [installed]
libglusterd0/focal,now 9.3-ubuntu1~focal1 amd64 [installed,automatic]
libglusterfs0/focal,now 9.3-ubuntu1~focal1 amd64 [installed,automatic]

Does not work!

The spinning wheel keeps ongoing...


[root@cluster01 ~]# GLUSTER_BIN_PATH=$(which gluster)
[root@cluster01 ~]# gdash --debug --gluster $GLUSTER_BIN_PATH

  • Running on http://0.0.0.0:8080/
  • Restarting with reloader
    172.31.10.203 - - [07/Jan/2015 15:07:17] "GET / HTTP/1.1" 200 -
    172.31.10.203 - - [07/Jan/2015 15:07:17] "GET /data HTTP/1.1" 500 -
    Traceback (most recent call last):
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1836, in call
    return self.wsgi_app(environ, start_response)
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
    File "/usr/lib/python2.6/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/usr/lib/python2.6/site-packages/gdash/app.py", line 90, in get_data
    result = json.dumps(parse(clusters, args))
    File "/usr/lib/python2.6/site-packages/gdash/cliparser.py", line 218, in parse
    volumes += get_volumes(cluster_name, hosts, args)
    File "/usr/lib/python2.6/site-packages/gdash/cliparser.py", line 195, in get_volumes
    vols = get_vol_info(cluster_name, hosts, args)
    File "/usr/lib/python2.6/site-packages/gdash/cliparser.py", line 176, in get_vol_info
    return get_vol_info_from_host(cluster_name, host, args)
    File "/usr/lib/python2.6/site-packages/gdash/cliparser.py", line 146, in get_vol_info_from_host
    raise GlusterBadXmlFormat(str(e))
    GlusterBadXmlFormat: 'NoneType' object has no attribute 'text'

New import revision needed

ImportError: cannot import name GAEMemcachedCache
ImportError: No module named contrib.cache
ImportError: cannot import name import_string

react-router-dom upgrade issues

From Gluster Slack

Tai Nguyen Huu 2:21 PM:

Hi everyone, I have a cluster glusterfs. I have install gdash to manage the cluster. I installed gdash use pip3 install gdask and enable by command gdash web.glusterfs.com --auth-file a.txt --port 10000. When I connect to dashboard from browser, I get the error GET /api/volumes HTTP/1.1" 403 22 "http://10.84.86.36:10000/volumes"

Aravinda (kadalu.tech) 2:50 PM:

Looks like a new issue while redirecting to login screen. I will look into the issue. As a workaround, can you try http://10.84.86.36:10000/login and then open http://10.84.86.36:10000/

How to deploy from the Repository?

Hi

Please could you give instructions on how to deploy this from the git repository? There are more files in the pypi package and other variances when compared to the git repo, I'm not sure if there is something I need to run to correct this.

I've got some issues running dashboard, to be fair, I think the issue is in glustercli, but I'd like to investigate why these are happening, put a fix together if possible.

Thanks

Infinite scroll incase of higher number of volumes

I was experimenting with the gdash. Thought of applying it for a setup wherein I was running a scale test for glusterfs ( having some 4k volumes). Now, the issue is not about the time taken for the display ( Probably that should be taken care if we have pagination in place..).

So, we have an infinite scroll. Now, from a user perspective, I think we can have pagination which can give a better user experience.

ImportError: No module named ext.cache

[root@localhost trunk]# gdash
Traceback (most recent call last):
File "/usr/bin/gdash", line 9, in
load_entry_point('gdash==0.4', 'console_scripts', 'gdash')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/site-packages/gdash/app.py", line 12, in
from flask.ext.cache import Cache
ImportError: No module named ext.cache

Error when visiting /api

For the past 2-3 versions the /api endpoint is throwing an error. This is regardless of HTTP/HTTPS.

Option to provide gluster bin location

If glusterfs is installed using make install, and PATH env is not set globally. gdash will fail to work. We need an option to specify gluster bin location.

Issue reported by Kotresh.

Loading dashboard, volumes, bricks causes HTTP 500

Loading pages other than peers results in a HTTP 500 error:

Bildschirmfoto 2022-03-18 um 13 46 21

The CLI shows the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/lib/encoding.py", line 223, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/gdash/__main__.py", line 99, in volumes
    return volume.status_detail(group_subvols=True)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/volume.py", line 189, in status_detail
    group_subvols=group_subvols)
  File "/usr/local/lib/python3.6/dist-packages/glustercli/cli/parsers.py", line 307, in parse_volume_status
    brick_online = brick_status_data.get("online", False)
AttributeError: 'NoneType' object has no attribute 'get'

Any ideas how to debug this?

We'r running glusterfs version 4.1.5 on Ubuntu 18.04 with python 3.6.9.

gdash HTTP500

hello,I Start gdash service in any one of the Gluster server node. access http://localhost:8080, Console error:

Traceback (most recent call last):
  File "/usr/local/lib64/python3.7/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/usr/local/lib64/python3.7/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/usr/local/lib64/python3.7/site-packages/cherrypy/lib/encoding.py", line 219, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib64/python3.7/site-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/usr/local/lib64/python3.7/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/gdash/__main__.py", line 99, in volumes
    return volume.status_detail(group_subvols=True)
  File "/usr/local/lib/python3.7/site-packages/glustercli/cli/volume.py", line 187, in status_detail
    return parse_volume_status(volume_execute_xml(cmd),
  File "/usr/local/lib/python3.7/site-packages/glustercli/cli/utils.py", line 134, in volume_execute_xml
    return gluster_execute_xml(cmd)
  File "/usr/local/lib/python3.7/site-packages/glustercli/cli/utils.py", line 119, in gluster_execute_xml
    return execute_or_raise(cmd)
  File "/usr/local/lib/python3.7/site-packages/glustercli/cli/utils.py", line 102, in execute_or_raise
    raise GlusterCmdException((returncode, out, err))
glustercli.cli.utils.GlusterCmdException: (1, 'Connection failed. Please check if gluster daemon is operational.\n', '')

The start command is gdash localhost,gdash host machine ip,It's the same error

How can I deal with it?

thank you

How to find gdash

I did a git clone. It's at commit a3d11d2. Where is the gdash executable, or how do I compile it?

Do I have to install pip (I'm guessing this is python-pip)? I hate crap package managers like gem/composer that want to do a substandard duplication/implementation of apt. Since it's written in python, can't I just run a python script or cat the .py files together and run?

I need to install this via Ansible, so running all kinds of goofy environmental commands is not realistic.

Auto refresh

It would be great if autorefresh is built into gdash with a selectable amount of seconds to refresh the dashboard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.