安裝alertmanger

solomon123發表於2024-11-02

1. 安裝alertmanger

wget https://github.com/prometheus/alertmanager/releases/download/v0.21.0/alertmanager-0.21.0.linux-amd64.tar.gz
tar -zxvf alertmanager-0.21.0.linux-amd64.tar.gz -C /usr/local
cd /usr/local/alertmanager-0.21.0.linux-amd64

 

2. 啟動

./alertmanger

  

3. 編寫啟動檔案啟動

[Unit]
Description=alertmanager
After=network.target

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/usr/local/alertmanager
ExecStart=/bin/sh -c '/usr/local/alertmanager/alertmanager --web.external-url=http://192.168.17.12:9093/  --log.level=debug >>/usr/local/alertmanager/alertmanager.log 2>&1 '
Restart=on-failure

[Install]
WantedBy=multi-user.target

  

4. 啟動服務

systemctl daemon-reload && systemctl enable alertmanager.service && systemctl start alertmanager.service

  

相關文章