From 11ce8e92dd41ec2389a8100109879b0fab2b20b0 Mon Sep 17 00:00:00 2001 From: "e.medina" Date: Tue, 18 Nov 2025 11:53:25 +0100 Subject: [PATCH] Service Prometheus --- prometheus.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/prometheus.md b/prometheus.md index a06d077..5a89dfc 100644 --- a/prometheus.md +++ b/prometheus.md @@ -34,6 +34,39 @@ mkdir /var/lib/prometheus chown -R prometheus:prometheus /var/lib/prometheus ``` +Créer le service + +```shell +nano /etc/systemd/system/prometheus.service +``` + +``` +[Unit] +Description=Prometheus Monitoring +Wants=network-online.target +After=network-online.target + +[Service] +User=prometheus +Group=prometheus +Type=simple +ExecStart=/usr/local/bin/prometheus \ + --config.file /etc/prometheus/prometheus.yml \ + --storage.tsdb.path /var/lib/prometheus/ \ + --web.console.templates=/etc/prometheus/consoles \ + --web.console.libraries=/etc/prometheus/console_libraries +Restart=always + + +[Install] +WantedBy=multi-user.target +``` + +```shell +systemctl daemon-reload +systemctl enable --now prometheus +``` + ## Raspberry Pi 3B+ ```shell