7°

Prometheus-alertmanager安装

1 下载

wget https://github.com/prometheus/alertmanager/releases/download/v0.18.0/alertmanager-0.18.0.linux-amd64.tar.gz -P /usr/local/

2 安装

tar  xf alertmanager-0.18.0.linux-amd64.tar.gz
mv alertmanager-0.18.0.linux-amd64 alertmanager

3 配置为系统服务

cat>/lib/systemd/system/alertmanager.service<<EOF
[Service]
Restart=on-failure
WorkingDirectory=/usr/local/alertmanager/
ExecStart=/bin/sh -c '/usr/local/alertmanager/alertmanager --config.file=/usr/local/alertmanager/alertmanager.yml'
[Install]
WantedBy=multi-user.target
EOF

chown 644 /lib/systemd/system/alertmanager.service systemctl daemon-reload systemctl enable alertmanager systemctl start alertmanager systemctl status alertmanager

 

本文由【拜】发布于开源中国,原文链接:https://my.oschina.net/54188zz/blog/3072978

全部评论: 0

    我有话说: