【教學】Prometheus AlertManager 安裝與服務化流程 (Ubuntu18.04)

 



下載 AlertManager

wget https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-amd64.tar.gz

最新版本下載點

解壓縮

tar -xzvf alertmanager-0.23.0.linux-amd64.tar.gz

移動至目錄底下

cd alertmanager-0.23.0.linux-amd64

搬移 amtool 與 alertmanager 至 /usr/local/bin 底下

mv amtool alertmanager /usr/local/bin

測試指令是否能正常運行

alertmanager -h

創建 alermanager 主設定檔資料夾

mkdir -p /etc/alertmanager

創建 alertmanager 存放資料夾

mkdir -p /dbdata/alertmanager

建立 alertmanager 使用者

useradd -rs /bin/false alertmanager

移動主設定檔至 /etc/alertmanager 底下

mv alertmanager.yml /etc/alertmanager

變更權限

chown -R alertmanager:alertmanager /dbdata/alertmanager /etc/alertmanager/*

建立服務檔

vim /lib/systemd/system/alertmanager.service

貼上以下內容

[Unit]
Description=Alert Manager
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=alertmanager
Group=alertmanager
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/alertmanager \
--config.file=/etc/alertmanager/alertmanager.yml \
--storage.path=/dbdata/alertmanager \

Restart=always

[Install]
WantedBy=multi-user.target

設定 AlertManager 開機自動啟動

systemctl enable alertmanager

啟動 alertmanager 服務

systemctl start alertmanager

檢查是否成功運行

systemctl status alertmanager




留言

  1. Slot denominations vary from one cent to $5 on the general gaming floor, while the High Limit Slots room presents $1 to $1,000 bets. A Non-Smoking Slots room is conveniently located close to the Winners Way Garage. Inside, visitors will find a powerful number of the preferred slot titles in selection of|quite lots of|a wide selection of} 카지노사이트 denominations.

    回覆刪除