Service Prometheus

This commit is contained in:
2025-11-18 11:53:25 +01:00
parent 9de5ff22fb
commit 11ce8e92dd

View File

@@ -34,6 +34,39 @@ mkdir /var/lib/prometheus
chown -R prometheus:prometheus /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+ ## Raspberry Pi 3B+
```shell ```shell