Sign inSign up

guyadams99/glances-rpi

By guyadams99

•Updated about 9 years ago

Docker image for glances including export options and configuration for InfluxDB

Image
1

1.4K

guyadams99/glances-rpi repository overview

⁠Source

See source at https://github.com/guyadams/glances-rpi⁠

⁠Summary

This image was built to use the excellent glances tool on raspberry pi machines to export to Influx DB to in turn chart with Grafana. All the other export modules are in there (except cassandra which just takes forever to build and I don't need it - if you do, let me know in the comments and I will add). You will need to tweak the configuration options since I have only provided envrionment variables to set the Influx options. You can also change the last line of "start_glances.sh" if you want to do other things or use glances interactively.

This is one of my first docker images intended for use by people other than me - feedback is welcome.

⁠Supported Pi Models

This should run on any Raspberry Pi that can run docker (which I believe is all, but please correct me if this is not the case). I have done all the development work on a Pi3 so this is most likely to work well and also tested on my Pi0 W. However - be very careful setting INFLUX_TIME too small on a low powered device - the glances monitoring itself imposes a significant load.

⁠Usage

docker run -itd -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host \
  -e "INFLUX_HOST=1.2.3.4" \
  -e "INFLUX_USER=root" \
  -e "INFLUX_PASSWORD=yourpassword" \
  -e "INFLUX_TAGS=server:pi3super,owner:guyadams99" \
  -e "GLANCES_OPTIONS=--enable-process-extended" \
  guyadams99/glances-rpi

Note that the prefix approach that glances seems to prefer is not the best way to with with Influx. By using tags, and specifically setting the server tag, the dashboard you can find in github will 'just work' and as you add more hosts, these will appear in the Server drop down list as if by magic.

The following variables are mandatory if you want anything to work:

  • INFLUX_HOST - IP Address or resolvable hostname of your Influx instance
  • INFLUX_USER - username of your Influx instance (default is root)
  • INFLUX_PASSWORD - password of your Influx instance (default is changeme)
  • INFLUX_TAGS - tags to use. You should really set these to whatever makes sense to identify your machines. If you are running more than one Pi, you have to change the tags otherwise the data will end up smashed together in Influx and you will have no way of getting anything meaningful out. A good example may be: -e "INFLUX_TAGS=server:living_room_pi,owner:jbloggs,model:pi3"

Optional additional parameters:

  • INFLUX_PORT - default is 8086
  • INFLUX_DB - default is 'glances'
  • INFLUX_PREFIX - prefix to prepend to each measurement name - my advise is don't, do everything with tags
  • INFLUX_TIME - how often to generate data - default is '30' seconds but almost anything is possible. Be aware that setting this to run too fast will generate a significant self measurement issue, and it's easy to run a Pi, especially a small one, to 100% CPU just by trying to run this every few seconds.
  • GLANCES_OPTIONS - anything here is appended to the glances command - see options here http://glances.readthedocs.io/en/stable/glances.html⁠ - note that I have no idea what some of these will do to your output - have fun finding out!

⁠Changes to stock glances

  • Didn't install cassandra export - takes too long to compile
  • Two options related to CPU frequency were not showing inside docker so i disabled them in the code (see Dockerfile for details)

⁠Known issues

  • the fs measurement is reporting /etc/hosts and /etc/resolv.conf as mount points - no idea why

Tag summary

Content type

Image

Digest

Size

136.9 MB

Last updated

about 9 years ago

docker pull guyadams99/glances-rpi