下載blackbox_exporter
地址:https://github.com/prometheus/blackbox_exporter/releases
創建文件夾mkdir -p /opt/blackbox_exporter/
上傳安裝文件
解壓:tar -zxvf blackbox_exporter-0.25.0.linux-amd64.tar.gz
創建軟連接:ln -s blackbox_exporter-0.25.0.linux-amd64 /opt/blackbox_exporter/latest
注
共用Nodeexporter的證書
创建配置文件
vim /opt/blackbox_exporter/configuration.yml
输入以下内容
tls_server_config: cert_file: /opt/node_exporter/tlsCertificate.crt key_file: /opt/node_exporter/tlsCertificate.key basic_auth_users: prometheus: '$2y$10$cA9UlOBRKkOsKC2lWhe9c.coKHBMiB9GIOIuIXAvI3CoKKIJuFPom'
systemctl方式開機啟動配置
刪除舊的alertmanager.service
rm -rf /lib/systemd/system/blackbox_exporter.service
創建新的node_exporter.service
vim /lib/systemd/system/blackbox_exporter.service
輸入以下內容:
[Unit] Description=Prometheus Blackbox Exporter After=network.target [Service] Type=simple User=root Group=root ExecStart=/opt/blackbox_exporter/latest/blackbox_exporter --config.file=/opt/blackbox_exporter/blackbox.yml --web.config.file=/opt/blackbox_exporter/configuration.yml Restart=on-failure [Install] WantedBy=multi-user.target
啟動
systemctl daemon-reload systemctl restart blackbox_exporter.service systemctl enable blackbox_exporter.service systemctl status blackbox_exporter.service
查看
curl https://127.0.0.1:9115/
本文作者:澳门🇲🇴上班的IT人
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!