I took these notes while setting up Grafana and InfluxDB on Proxmox.
I hit a few minor issues so thought I’d post it here as a mini “How To” or reference for others.
This setup allows me to easily monitor my Proxmox host and the VMs and LXCs it runs via a nice Grafana dashboard, with the data/metrics stored in InfluxDB.
The main steps are:
1. Install Influx DB
2. Install Grafana
3. Configure Proxmox
4. Configure InfluxDB
5. Configure Grafana
Install InfluxDB
Proxmox makes this very quick and very easy, if you’re happy to trust the Community scripts available here:
https://community-scripts.github.io/ProxmoxVE/
which just means running this one-liner in the proxmox console:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/influxdb.sh)"
this created an InfluxDB LXC in a couple of minutes.
For me, the IP and port were: http://192.168.0.24:8086
Install Grafana
This was much the same with a different script, and just meant running:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/grafana.sh)"
then I also had a new Grafana instance here:
http://192.168.0.114:3000
Note that the default user:password for Grafana is admin:admin
Configure Proxmox
Next you need to set the Metrics Server used byProxmox, this will tell proxmox to send all metrics on itself and the VMs and LXCs it runs to InfluxDB.
This is set under “Datacenter” in the proxmox UI:
This looked straightforward too, but there were conflicting opinions on how to do it. I initially went with UDP which didn’t work for me; there was nowhere to set any authentication and I wasn’t allowing anonymous access to InfluxDB, so I switched to using HTTP which then allowed me to specify the (InfluxDB) credentials.
Configure InfluxDB
I created a “proxmox” organisation and a “proxmox” bucket in InfluxDB
I then created an API key/Token specifically for that proxmox bucket, which I used in the above pic.
To verify things were working between Proxmox and InfluxDB, I took a look in the data explorer:
You can see in that pic that InfluxDB has data on my VMs and LXCs, which it must have received from Proxmox, so I then knew my remaining issues were with the connection between InfluxDB <-> Grafana.
Configure Grafana
Initially I was getting “InfluxDB returned error: Unauthorized error reading influxDB” – hence the check above to confirm that Proxmox -> InfluxDB was working ok.
I couldn’t see anywhere in this version of Grafana to specify the Token for InfluxDB though – other screenshots on the ‘net had & used that option, but it wasn’t available for me 🙁
After some reading I learned you could set the Token by creating a new Custom HTTP Header called “Authorization” with the value “Token BXx…….7yBkw==” (that’s the word Token, a space, then the full Token you got from InfluxDB, all set as the Value for a new Custom HTTP Header called Authorization…)
This seemed surprisingly flaky to me, but it worked.
My (working) connection details look like this:
Prior to adding that HTTP Header, I was getting a successful connection but “0 measurements found”.
Next I added a new Proxmox dashboard to Grafana from here:
https://grafana.com/grafana/dashboards/10048-proxmox/
you don’t need to sign up there or anything else, just enter the ID: 10048 like in this pic and it’ll pull the Dashboard down:
Discover more from Don's Blog
Subscribe to get the latest posts sent to your email.