How to install Prometheus in Debian 11 – Guide

Prometheus is an open source software for monitoring computers, software and services. It can read various metrics from operating systems, software and services in real time and alert users to various events based on these metrics. In this article, I will talk about different parts of Prometheus and show you how to install it on Ubuntu 20.04 LTS. I’ll also show you the basics of how to use it to monitor your systems. Prometheus is an open source event monitoring and alerting system that collects and stores your metrics as time series data; H. Metric information is stored with the timestamp it was recorded, along with optional key-value pairs, so-called labels. ..

Prometheus is an open source system and service monitoring and alerting tool used to log services in real time and collect metrics in a time series database. It is written in Go and licensed under the Apache 2 license, which was originally developed by SoundCloud. Don’t forget to replace IP_Address and Port_Number with your server’s real IP address and SSH port number. You should also replace “root” with the username of the administrator account, if necessary. The default configuration of Prometheus only exports metrics about itself. However, you can extend it by installing exporters and other programs. It supports a multidimensional data model, multiple charts and dashboard modes.

Install Prometheus

groupadd -g Prometheus useradd -u Prometheus -g group -G “Prometheus”

Useradd -s /sbin/nologin –system -g prometheus prometheus

prometheus-3.0.2

Curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep browser_download_url | grep linux-amd64 | cut -d ‘”’ -f 4 | wget -qi –

Prometheus.exe

The following output is expected: You should see the following output: The following output is expected: ..

Prometheus is a monitoring system that collects data from systems and stores it in a time series database. ..

wget -O- https://raw.githubusercontent.com/bitcoin/bitcoin-core/master/bitcoin-core-1.11.0.tar.gz tar -xvf bitcoin-core-1.11.0.tar.gz

cd /tmp/ This will change the working directory to the extracted directory.

mkdir -p ~/Documents/MyProjects/src ~/Documents/MyProjects/bin cd ~/Documents/MyProjects && git init git add . && git commit -m “Initial commit” To create a new project, first create a directory for it using the following command: mkdir -p ~/Documents/MyProjects/new_project cd ~/Documents/MyProjects/new_project && git init git add . && git commit -m “Initial commit” ..

sudo apt-get update sudo apt-get install build-essential libssl-dev libcrypto++5.0-dev libpcap1.8-dev python3 python3pip sudo pip3 install -r requirements.txt

Prometheus Console Library

Prometheus is a monitoring system that collects data from systems and stores it in a time series database. It can be used to monitor system performance, detect problems early, and make informed decisions. The promtool utility is used to analyze the data collected by Prometheus. ..

After completing the steps in this guide, you can move on to the next step.

Create a Systemd service file for Prometheus

systemd-systemd create service Prometheus

This will create a new systemd service file in the /etc/systemd/system directory. You can then use this file to manage the Prometheus service.

Save and close the file and set proper ownership and permission to the Prometheus configuration directory: Set the permissions for the Prometheus configuration directory to be executable: chmod 755 Prometheusconfig

chown -R prometheus:prometheus /etc/prometheus/config.yml ..

chmod -R 775 /etc/prometheus/prometheus.log

chown -R prometheus:prometheus /var/lib/prometheus

systemctl reload systemd

prometheus-server –config-file=/etc/prometheus/prometheus.yml –storage-path=/var/lib/prometheus Prometheus should now be up and running. To check that it is, you can use the following command: prometheus -H If everything is working as expected, you should see a message like this: Output from ‘prometheus -H’: Hostname: localhost Collector1: localhost Collector2: localhost Alertmanager1: localhost Alertmanager2: localhost ..

Prometheus status

prometheus -v 9090

Configure Nginx as a reverse proxy for Prometheus

sudo apt-get install nginx Next, create a configuration file for Nginx to use as a reverse proxy for Prometheus. To do this, open the Nginx configuration file in your text editor of choice and add the following lines: server { listen 80; server_name localhost; location /prometheus { proxy_pass http://localhost:9090; } } ..

server { listen 80; server_name www.example.com; location / { proxy_pass http://www.example.com; proxy_set_header X-Forwarded-For $proxy_add_xfer; proxy_set_header X-Forwarded-Proto $proxy_protocol; } }

nginx -v If there are any errors, please let me know and I’ll try to fix them.

If everything is not ok, you will get the following output:

nginx: Configuration file /etc/nginx/nginx.conf was successfully created.

sudo service nginx restart

nginx -s status This will give you the current status of the Nginx service.

Access the Prometheus dashboard

The Prometheus dashboard is a web application that allows you to monitor and manage your systems. ..

Install and configure node_exporter

curl -sL https://github.com/prometheus/node_exporter/releases/download/v0.12.1/node_exporter-0.12.1-linux-amd64.tar.gz Next, extract the node_exporter archive: tar xvf node_exporter-0.12.1-linux-amd64.tar.gz Next, install node_exporter using the following command: sudo npm install -g node_exporter ..

tar -xvf ~/Downloads/MyFile.tar

mkdir -p /etc/prometheus/

cd /etc/prometheus/

Then extract the data from the log files:

sudo tar -xvf data.tar.gz

Finally, create a configuration file for Prometheus:

sudo nano prometheus.yml

..

setProperty “name” “value” This will set the name property to the value of “name” on the object.

chown -R prometheus:prometheus /etc/prometheus/node_exporter /usr/local/bin

[Unit] Description=Node Exporter After=network.target [Service] Type=oneshot #!/bin/bash export NODE_EXPORTER_OPTS="-d -p tcp –dport 8081" service systemd-node-exporter restart ..

Save and close the file and reload systemd daemon to apply the changes: systemctl save & systemctl reload

  1. On your server, start the node_exporter service.
  2. Enable the service to start on system reboot. ..

node_exporter status This will give you the status of the node_exporter.

node_exporter -p 9100 This will export the files to the localhost on port 9100.

Add node_exporter to Prometheus Server

sudo nano /etc/prometheus/prometheus.yml and adding the following line: node_exporter:

  • host: localhost Now you can start Prometheus by running the following command: sudo service prometheus start ..

job_name: node_exporter This will export all the nodes in the job to a CSV file. ..

Save and close the file and restart the Prometheus service.

Final note

If you’re looking to install Prometheus in Debian 11, we’ve put together a guide that will show you how. If you have any questions about this guide or anything else related to Debian 11, please don’t hesitate to ask us. And finally, please share this guide with your friends!