• 欢迎访问运维搬运工网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 本站一年会员:100元 ,两年会员:180元 ,永久会员:380元
  • 这世界就是,一些人总在昼夜不停地运转,而另外一些人,起床就发现世界已经变了。
  • 本博客推广的是知识付费,用赞助的方式实现博客维护,不以赚钱为目的的博客

Blackbox exporter

Blackbox_exporter概述

blackbox exporter是允许在HTTP, HTTPS, DNS, TCP and ICMP等协议的端点进行黑盒探测的采取器
官方github: https://github.com/prometheus/blackbox_exporter

下载

注意:本段内容须“登录”后方可查看!

[root@lucky ~]# cd /usr/local/src/
[root@lucky src]# ll
total 70320
-rw-r--r-- 1 root root 0 Oct 18 00:19 alertmanager-0.19.0.linux-amd64.tar.gz
drwxr-xr-x 8 10 143 4096 Sep 6 2017 jdk1.8.0_151
-rw-r--r-- 1 root root 7018111 Nov 30 2018 node_exporter-0.17.0.linux-amd64.tar.gz
-rw------- 1 root root 8083296 Oct 16 20:58 node_exporter-0.18.1.linux-amd64.tar.gz
-rw------- 1 root root 2861 Oct 18 00:34 nohup.out
drwxr-xr-x 2 3434 3434 4096 Oct 17 15:15 prometheus-2.13.0.linux-amd64
-rw------- 1 root root 56885361 Oct 16 19:46 prometheus-2.13.0.linux-amd64.tar.gz
[root@lucky src]# wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.15.1/blackbox_exporter-0.15.1.linux-amd64.tar.gz

解压

[root@lucky src]# tar -xzvf blackbox_exporter-0.15.1.linux-amd64.tar.gz 
[root@lucky src]#  mkdir /usr/local/prometheus
[root@lucky src]# mv blackbox_exporter-0.15.1.linux-amd64 /usr/local/prometheus/blackbox_exporter
[root@lucky src]# useradd prometheus
[root@lucky src]#  chown -R prometheus:prometheus /usr/local/prometheus

添加启动服务

[root@lucky 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@lucky src]# systemctl enable blackbox_exporter.service
[root@lucky src]# systemctl start blackbox_exporter.service
[root@lucky 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 Fri 2019-10-18 15:17:16 CST; 10s ago
Main PID: 4824 (blackbox_export)
CGroup: /system.slice/blackbox_exporter.service
└─4824 /usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbox_exporter/blackbox.yml

Oct 18 15:17:16 lucky systemd[1]: Started blackbox_exporter.
Oct 18 15:17:16 lucky blackbox_exporter[4824]: level=info ts=2019-10-18T07:17:16.138Z caller=main.go:212 msg="Starting blackbox_exporter" version="(version=0.15.1, branch=HEAD, rev...12509e46ce)"
Oct 18 15:17:16 lucky blackbox_exporter[4824]: level=info ts=2019-10-18T07:17:16.138Z caller=main.go:213 msg="Build context" (gogo1.13,userroot@626ba8fd110c,date20190917-12:31:25)=(MISSING)
Oct 18 15:17:16 lucky blackbox_exporter[4824]: level=info ts=2019-10-18T07:17:16.139Z caller=main.go:225 msg="Loaded config file"
Oct 18 15:17:16 lucky blackbox_exporter[4824]: level=info ts=2019-10-18T07:17:16.139Z caller=main.go:369 msg="Listening on address" address=:9115
Hint: Some lines were ellipsized, use -l to show in full.


运维搬运工 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Blackbox exporter
喜欢 (0)
[扫描二维码]
分享 (0)
大自然搬运工
关于作者:
不是路不平,而是你不行。到底行不行,看你停不停。只要你不停,早晚都能行。
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址