環(huán)境
系統(tǒng):CentOS 7.5
軟件:blackbox_exporter-0.12.0.linux-amd64.tar.gz
安裝
下載二進(jìn)制包
地址:https://github.com/prometheus/blackbox_exporter/releases-
安裝
# tar -xzvf blackbox_exporter-0.12.0.linux-amd64.tar.gz # mkdir /usr/local/prometheus # mv blackbox_exporter-0.12.0.linux-amd64 /usr/local/prometheus/blackbox_exporter
-
創(chuàng)建用戶并授權(quán)
# useradd prometheus # chown -R prometheus:prometheus /usr/local/prometheus
啟動(dòng)
-
添加啟動(dòng)服務(wù)
# vim /usr/lib/systemd/system/blackbox_exporter.service [Unit] Description=blackbox_exporter After=network.target [Service] Type=simple User=prometheus ExecStart=/usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbox_exporter/blackbox.yml Restart=on-failure [Install] WantedBy=multi-user.target
-
啟動(dòng)
# systemctl enable blackbox_exporter.service # systemctl start blackbox_exporter.service