You have now only one datasource in your Grafana installation which is called “InfluxDB”. You need to make same kind of new datasource. If you have your Glances data flowing into InfluxDB, you only need to add new datasource into Grafana which points into InfluxDB database where Glances data is, maybe like called “Glances”.
@sender, and now as you have that glances influxdb datasource set up in the Grafana, if you import the dashboard again, can you select the Glances datasource from the list and it still gives those red errors “! database name required”?
Hey nikop. Thank you very much for your brilliant work done. Surprisingly for me, when I followed Frenck’s YouTube video and then downloaded Nicolargo’s dashboard from Grafana.com (updated two months ago!) it didn’t work for me. I was frustrated. Luckily I found this topic. Your dashboard is working for me like a charm, so I really appreciate your effort.
I just did set this up and it was working great directly after I imported your dashboard, @nikop, thanks a lot!
However whenever I now try to open the new dashboard in Grafana it starts to render (I can see the number of CPU cores in the top left) but then the page instantly crashes in Google Chrome with error 5.
Closed the browser, emptied the cache but no change.
Now after a few minutes it suddenly displays again, really bizarre…
Let’s see if it stays stable now
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)
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 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: