Skip to content

Deploy server agents

Now let’s setup our monitoring agent.

Glouton is a monitoring agent that makes observing your infrastructure easy. It provides a lot of features:

  • gathers system metrics from Prometheus node_exporter
  • automatically discovers your services to retrieve relevant metrics.
  • Kubernetes native: create metrics and checks for pods

To install the agent on your system using the install script please follow these instructions.

There is a docker compose available to quickly deploy the agent. Simply download the content of the folder and run:

docker compose up -d

We need to configure the agent to send its metrics to NATS. We assume here that NATS is running on our monitoring server which has the IP 192.168.1.101, as in the diagram below.

Network Network

The following command will create the configuration file glouton.conf to tell the agent the address of our MQTT server and the metrics it should send.

Terminal window
# This should be the address where the NATS MQTT server is running
MONITORING_SERVER_ADDRESS="192.168.1.101"
cat > glouton.conf << EOF
bleemeo:
enable: false
mqtt:
enable: true
hosts:
- $MONITORING_SERVER_ADDRESS
port: 1883
# Allow node exporter metrics.
metric:
allow_metrics:
- node_*
EOF

Now we can run Glouton:

Terminal window
docker run -d --name="glouton" --restart unless-stopped \
-v $(pwd)/glouton.conf:/etc/glouton/conf.d/90-local.conf:ro \
-v /var/lib/glouton:/var/lib/glouton -v /var/run/docker.sock:/var/run/docker.sock \
-v /:/hostroot:ro --pid=host --net=host \
--cap-add SYS_PTRACE --cap-add SYS_ADMIN bleemeo/bleemeo-agent

We can check the logs to make sure everything is working:

Terminal window
docker logs -f glouton

You should see the message Open Source MQTT connection established.

To sum up what we did, we set up a working Time Series Database to store our metrics, we started a MQTT server, SquirrelDB Ingestor and a monitoring agent. The agent sends its metrics to MQTT, SquirrelDB Ingestor reads them and write them in SquirrelDB.

Firstly, we should create a config file /etc/glouton/conf.d/80-community-edition.conf used to tell the agent the address of our MQTT server and the metrics it should send. You can do this with the following commands:

Terminal window
sudo mkdir -p /etc/glouton/conf.d
sudo tee /etc/glouton/conf.d/80-community-edition.conf << EOF
# We disable the Bleemeo part
bleemeo:
enable: false
# We tell to glouton to connect to our mqtt instance(s)
mqtt:
enable: true
hosts:
- 192.168.1.101
port: 1883
# Allow node exporter metrics.
metric:
allow_metrics:
- node_*
EOF
sudo chmod 640 /etc/glouton/conf.d/80-community-edition.conf

And follow the Bleemeo installation guide to install the agent on your system. Remember to ignore the mentions of account id or registration key.

For further configuration, please follow the Bleemeo one and ignore all the mentions of account id or registration key.