2022 version of Grafana dashboard for Glances + InfluxDB

same here for me… Thanks @nikop !

1 Like

Stills works out of the box - great job!

Only thing with most recent version is that no container data is showing?

1 Like

I got containers working again, here’s the SQL Statement:

SELECT mean("cpu_percent") FROM "localhost.containers" WHERE ("name" =~ /^$container$/ AND "hostname" =~ /^$host$/) AND $timeFilter GROUP BY time($__interval) fill(none)

SELECT mean("memory_usage") FROM "localhost.containers" WHERE ("name" =~ /^$container$/ AND "hostname" =~ /^$host$/) AND $timeFilter GROUP BY time($__interval) fill(none)
2 Likes

Please ignore my ignorance, but where do you enter these SQL-commands to get containers to show up please?

UPDATE: Edited the JSON model from settings:

Search for ‘cpu_percent’ and ‘memory_usage’ and replace the queries between double quotes.

However, it is not working yet so perhaps a refresh/reload is needed. No data still:

I’ll update this post if it starts working after a while.

It should work like this, or you edit the panel directly in Grafana and change the SQL statement:

Hey thanks for adding that note. An error pops up. Anyone a clue on what I’m doing wrong here please?
image

Configuration (copy 'n paste form above post:

Got it working when also changing measurement from “localhost.docker” to “localhost.containers”

Working code snippet based on the Grafana - 2022 dashboard:


          "measurement": "localhost.containers",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT mean(\"cpu_percent\") FROM \"localhost.containers\" WHERE (\"name\" =~ /^$container$/) AND $timeFilter GROUP BY time($__interval) fill(none)",

I too have issues getting Grafana to show any data in the fields. I’ve been trying multiple things, but I’m sure I’m doing something completely wrong.

I can access Glances data inside Grafana and can even alter a few fields if I want. The issue seems to be that the Glances dashboard hasn’t got any variables, like /^$host$/, to chose from. When I edit a dashboard section, directly enter something like localhost.cpu in the FROM field and delete the WHERE variable, I can get something on the screen.

My settings (after trying many different things from multiple, maybe even obscure, places) in Glances config under influxdb are:

enabled: true
host: a0d7b954-influxdb
port: 8086
interval: 60
ssl: false
version: 2
username: hainfluxuser
password: <password>
database: glances –export influxdb2
prefix: localhost
token: >-
  EjFUTWe8U-MIseEAkaVIgVnej_TrnbdvEcRkaB1imstW7gapSqy6_6-8XD-yd51V0zUUpDy-kAdVD1purDLuxA==
bucket: glances
org: nicolargo

I would love to get this going. Thanks!

Hello,

I had to do the changes posted up here also. Therefor I added an updated version on: Glances 2024

Credits to:

  • original work - Glances by nicolargo
  • Glances - 2022 by nikopaulanne
  • And forum members overhere

1 Like