2025-11-06 20:08:05 +01:00
|
|
|
# Prometheus
|
|
|
|
|
|
2025-11-18 11:44:11 +01:00
|
|
|
## Debian 13
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
useradd --system --no-create-home --user-group --shell /usr/sbin/nologin prometheus
|
|
|
|
|
wget https://github.com/prometheus/prometheus/releases/download/v3.7.3/prometheus-3.7.3.linux-amd64.tar.gz
|
|
|
|
|
tar xvf prometheus-*.tar.gz
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Déplacer les binaires
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
mv prometheus-*/prometheus /usr/local/bin/
|
|
|
|
|
mv prometheus-*/promtool /usr/local/bin/
|
|
|
|
|
chown prometheus:prometheus /usr/local/bin/prometheus
|
|
|
|
|
chown prometheus:prometheus /usr/local/bin/promtool
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Créer le dossier de configuration
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
mkdir /etc/prometheus
|
|
|
|
|
mkdir /etc/prometheus/consoles
|
|
|
|
|
mkdir /etc/prometheus/console_libraries
|
|
|
|
|
mv prometheus-*/prometheus.yml /etc/prometheus
|
|
|
|
|
chown -R prometheus:prometheus /etc/prometheus
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Créer le dossier pour les données
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
mkdir /var/lib/prometheus
|
|
|
|
|
chown -R prometheus:prometheus /var/lib/prometheus
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Raspberry Pi 3B+
|
2025-11-06 20:08:05 +01:00
|
|
|
|
|
|
|
|
```shell
|
2025-11-18 07:43:57 +01:00
|
|
|
wget https://github.com/prometheus/prometheus/releases/download/v3.7.3/prometheus-3.7.3.linux-armv7.tar.gz
|
|
|
|
|
tar xfz prometheus-3.7.3.linux-armv7.tar.gz
|
|
|
|
|
mv prometheus-3.7.3.linux-armv7 prometheus
|
|
|
|
|
rm prometheus-3.7.3.linux-armv7.tar.gz
|
|
|
|
|
sudo nano /etc/systemd/system/prometheus.service
|
2025-11-06 20:08:05 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=Prometheus Server
|
|
|
|
|
Documentation=https://prometheus.io/docs/introduction/overview/
|
|
|
|
|
After=network-online.target
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
User=iut
|
|
|
|
|
Restart=on-failure
|
|
|
|
|
|
|
|
|
|
ExecStart=/home/iut/prometheus/prometheus \
|
|
|
|
|
--config.file=/home/iut/prometheus/prometheus.yml \
|
|
|
|
|
--storage.tsdb.path=/home/iut/prometheus/data
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```shell
|
2025-11-18 07:43:57 +01:00
|
|
|
$ sudo systemctl enable --nows prometheus
|
2025-11-06 20:08:05 +01:00
|
|
|
$ sudo systemctl status prometheus
|
|
|
|
|
```
|