blackbox_exporter安装

DevOps Prometheus评论2,029字数 2114阅读7分2秒阅读模式

简述

Prometheus提供了一个blackbox_exporter可以实现网络监控,支持http、dns、tcp、icmp等监控

二进制包部署

下载地址:https://prometheus.io/download/

blackbox_exporter安装

[root@iZ8vb623n6mbyx9d66w0a9Z tmp]# tar -xzvf blackbox_exporter-0.22.0.linux-amd64.tar.gz -C /usr/local/
[root@iZ8vb623n6mbyx9d66w0a9Z tmp]#  mv /usr/local/blackbox_exporter-0.22.0.linux-amd64 /usr/local/prometheus/blackbox_exporter

启动脚本

[root@iZ8vb623n6mbyx9d66w0a9Z tmp]# vim /usr/lib/systemd/system/blackbox_exporter.service
[Unit]
Description=blackbox_exporter
After=network.target
After=syslog.target 
[Service]
ExecStart=/usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbox_exporter/blackbox.yml
  
[Install]
WantedBy=multi-user.target

启动服务

[root@iZ8vb623n6mbyx9d66w0a9Z tmp]# systemctl enable blackbox_exporter.service
Created symlink from /etc/systemd/system/multi-user.target.wants/blackbox_exporter.service to /usr/lib/systemd/system/blackbox_exporter.service.
[root@iZ8vb623n6mbyx9d66w0a9Z tmp]#  systemctl start blackbox_exporter.service
[root@iZ8vb623n6mbyx9d66w0a9Z tmp]# systemctl status blackbox_exporter.service
● blackbox_exporter.service - blackbox_exporter
   Loaded: loaded (/usr/lib/systemd/system/blackbox_exporter.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2022-11-22 17:49:09 CST; 8s ago
 Main PID: 12975 (blackbox_export)
   CGroup: /system.slice/blackbox_exporter.service
           └─12975 /usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbo...

Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z systemd[1]: Started blackbox_exporter.
Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z blackbox_exporter[12975]: ts=2022-11-22T09:49:09.655Z caller=main.go:256 leve...0)"
Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z blackbox_exporter[12975]: ts=2022-11-22T09:49:09.655Z caller=main.go:257 leve...0)"
Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z blackbox_exporter[12975]: ts=2022-11-22T09:49:09.656Z caller=main.go:269 leve...le"
Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z blackbox_exporter[12975]: ts=2022-11-22T09:49:09.656Z caller=main.go:417 leve...115
Nov 22 17:49:09 iZ8vb623n6mbyx9d66w0a9Z blackbox_exporter[12975]: ts=2022-11-22T09:49:09.656Z caller=tls_config.go:19...lse
Hint: Some lines were ellipsized, use -l to show in full.

 

继续阅读
DevOps
  • 本文由 发表于 2022年11月22日 17:50:01
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
  • blackbox_exporter
prometheus告警规则 Prometheus

prometheus告警规则

基础监控 主机内存不足 节点内存已满(剩余 < 10%) groups: - name: Node memory is filling up (< 10% left) rul...
评论  0  访客  0

发表评论