Blackbox Exporter安装04

IT
IT
IT
335
文章
1
评论
2020年3月23日11:53:50 评论 1,524 2773字阅读9分14秒

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

安装

[root@iZ2ze4v2sdd3v6w7w8doecZ src]# ll
total 71568
-rwxr-xr-x 1 root root  8308336 Oct 26 16:08 blackbox_exporter-0.15.1.linux-amd64.tar.gz
-rw-r--r-- 1 root root  8083296 Oct 26 14:31 node_exporter-0.18.1.linux-amd64.tar.gz
-rw-r--r-- 1 root root 56885361 Oct 26 14:32 prometheus-2.13.0.linux-amd64.tar.gz
[root@iZ2ze4v2sdd3v6w7w8doecZ src]# tar -xzvf blackbox_exporter-0.15.1.linux-amd64.tar.gz
blackbox_exporter-0.15.1.linux-amd64/
blackbox_exporter-0.15.1.linux-amd64/blackbox_exporter
blackbox_exporter-0.15.1.linux-amd64/NOTICE
blackbox_exporter-0.15.1.linux-amd64/LICENSE
blackbox_exporter-0.15.1.linux-amd64/blackbox.yml
[root@iZ2ze4v2sdd3v6w7w8doecZ src]# mkdir /usr/local/prometheus
[root@iZ2ze4v2sdd3v6w7w8doecZ src]# mv blackbox_exporter-0.15.1.linux-amd64 /usr/local/prometheus/blackbox_exporter
[root@iZ2ze4v2sdd3v6w7w8doecZ src]# chown -R prometheus:prometheus /usr/local/prometheus

添加启动服务

[root@iZ2ze4v2sdd3v6w7w8doecZ src]# 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

启动

[root@iZ2ze4v2sdd3v6w7w8doecZ src]# 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@iZ2ze4v2sdd3v6w7w8doecZ src]# systemctl start blackbox_exporter.service
[root@iZ2ze4v2sdd3v6w7w8doecZ src]# 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 Sat 2019-10-26 16:12:26 CST; 6s ago
 Main PID: 11675 (blackbox_export)
   CGroup: /system.slice/blackbox_exporter.service
           └─11675 /usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbox_exporter/blackbox.yml
 
Oct 26 16:12:26 iZ2ze4v2sdd3v6w7w8doecZ systemd[1]: Started blackbox_exporter.
Oct 26 16:12:26 iZ2ze4v2sdd3v6w7w8doecZ blackbox_exporter[11675]: level=info ts=2019-10-26T08:12:26.602Z caller=main.go:212 msg="Starting blackbox_exporter" versio...9e46ce)"
Oct 26 16:12:26 iZ2ze4v2sdd3v6w7w8doecZ blackbox_exporter[11675]: level=info ts=2019-10-26T08:12:26.602Z caller=main.go:213 msg="Build context" (gogo1.13,userroot@...MISSING)
Oct 26 16:12:26 iZ2ze4v2sdd3v6w7w8doecZ blackbox_exporter[11675]: level=info ts=2019-10-26T08:12:26.603Z caller=main.go:225 msg="Loaded config file"
Oct 26 16:12:26 iZ2ze4v2sdd3v6w7w8doecZ blackbox_exporter[11675]: level=info ts=2019-10-26T08:12:26.603Z caller=main.go:369 msg="Listening on address" address=:9115
Hint: Some lines were ellipsized, use -l to show in full.
下载信息 blackbox_exporter-0.15.1.linux-amd64.tar.gz
网盘密码:登录可见
下载地址
继续阅读
  • 我的QQ
  • QQ扫一扫
  • weinxin
  • 我的头条
  • 头条扫一扫
  • weinxin
IT
  • 本文由 发表于 2020年3月23日11:53:50
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
应用端口监控 prometheus

应用端口监控

是指监控每个服务启动的端口,根据端口来判断服务存活。 lucky可以指定每个应用的负责人 # vim prometheus.yml - job_name: 'dispatch' metrics_pat...