Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)

Spread the love

Overview

After Testing this Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana on a Docker Compose Container and finding it worked really well until the container was rebooted as it lost all its InfluxDB settings even though it was configured with persistent disks, I decided to create a new Proxmox LXC Ubuntu 22.04 container and permanently install and configure InfluxDB and Grafana to make the monitoring solution way more stable for a Production Environement.

After installing a standard Ubuntu 22.04 Proxmox LXC container. I did the following to setup my monitoring solution for my Production monitoring solution:

Initial Container Setup

After your container is installed and booted up there are some inital setup steps that need doing before we can start installing out monitoring system. These are:

Update apt by running:

apt update

Upgrade Ubuntu by running:

apt upgrade -y

Next install vim and gpg by running:

apt install vim gpg

Type y and enter to install:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 1

Once the install finishes we need to edit the sshd_config to allow root ssh access so that we can ssh to the container by running:

vim /etc/ssh/sshd_config

Find the #PermitRootLogin prohibit-password line:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 2

Change it to PermitRootLogin yes :

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 3

Save the changes and you should now be able to ssh to the container from your local machine:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 4

Install InfluxDB

Now that the Container is all setup we can install the InfluxDB which will be used to save the monitoring information from the Proxmox cluster. Unfortunately there is no InfluxDB installer natively in apt so we habe to manually add the repo with gpg and then install it as follows:

Run the following command to download the key for the custom repos:

wget -q https://repos.influxdata.com/influxdata-archive_compat.key

Add the key with:

echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null

Add the repo to apt by running:

echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list

Update the package list with:

sudo apt-get update

Install Influxdb2 with the following command:

sudo apt-get install influxdb2 -y

When the installation finishes check the version by running:

influx version

It should show the version of Influxdb:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 5

Start the service by running:

sudo systemctl start influxdb

Enable InfluxDB as a service by running:

sudo systemctl enable influxdb

Allow access to port 8086 by running:

sudo ufw allow 8086/tcp

Here are some useful commands for Influxdb:

Show current status by running:

sudo service influxdb status

Restart by running:

sudo service influxdb restart

Stop by running:

sudo service influxdb stop

Start by running:

sudo service influxdb start

Configure InfluxDB

To configure InfluxDB connect to the Container in a browser with http://hostIP:8086

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 6

Click on GET STARTED:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 7

Enter the details asked for and click CONTINUE:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 8

This will create a user for you. Copy the API Token for the use and save it somewhere safe as it will be needed later (this screen print is from an old install so not in use any more!):

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 9

Setting up InfluxDB within Proxmox

Open the Proxmox Cluster Gui and click on Datacenter (ci-ha-cluster)on the left hand menu, Click on Metric Server and Add:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 10

Select InfluxDB:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 11

Add the details and API Token created when setting up InfluxDB before and click Create:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 12

The new access will be shown in the right hand window:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 13


Now we need to test that Proxmox is connected to InfluxDB correctly so go back to influxdb in your browser (<hostIP>:8086):

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 14

Click on the icon that looks like a graph to open the Data Explorer page:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 15

Setup the query as below and click SUBMIT to test that there is a graph shown with data in it. If it is then we are good to move on:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 16

Install Grafana

Back on the server ssh Install the prerequisite packages needed to install Grafana by running:

sudo apt-get install -y apt-transport-https software-properties-common wget

Make the /etc/apt/keyrings folder by running:

sudo mkdir -p /etc/apt/keyrings/

Import the GPG key:

wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

To add a repository for stable releases, run the following command:

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

To add a repository for beta releases, run the following command:

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com beta main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

Update Apt by running:

sudo apt-get update

Install Grafana:

apt-get install grafana -y

Start the Grafana server with systemd

Run the following commands to start the Grafana service:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server

Configure the Grafana server to start at boot using systemd

To configure the Grafana server to start at boot, run the following command:

sudo systemctl enable grafana-server.service

Configuring Grafana

Next connect to the Graphana Server using a browser using http://<hostIP>:3000:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 17

Login as admin/ admin:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 18

Change the admin user password to the default password and click Submit:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 19

Click on the three lines on the top left hand corner and select Data Sources:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 20

Click Add data Source:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 21

Click on InfluxDB:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 22
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 23

If successful you will see the following message:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 24

Querying and Visualising Data in Grafana

Now that Proxmox is feeding into InfluxDB and InfluxDB is linked up with Grafana, we are ready to start querying data from the database and visualizing it with Grafana!

With us having chosen to use the Flux language, you will want to use dashboard that someone has already made in order to visualise your data.

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 25

 The dashboard ID is:

15356

In the Grafana Gui click on the menu icon (3 lines stacked on top of each other) and select Dashboards:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 26

Click on Create Dashboard:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 27

Click on Import dashboard:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 28

Paste the dashboard ID that we got earlier into the import dashboard field and press the Load button to the right of the import dashboard field:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 29

Select the influxdb in the proxmox-flux field and press Import:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 30

The dashboard will now be propagated:

Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution)
Proxmox Cluster Monitoring Dashboard with InfluxDB and Grafana (Production Solution) 31

The dashboard is now setup and should be working now 🙂 Enjoy!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top