1.按照exporter
1.wget https://github.com/prometheus/blackBox_exporter/releases/download/v0.12.0/blackBox_exporter-0.12.0.linux-amd64.tar.gz2.tar -zxf blackBox_exporter-0.12.0.linux-amd64.tar.gz3.mv blackBox_exporter-0.14.0.linux-amd64 /usr/local/blackBox_exporter4../blackBox_exporter --version
2.vim /lib/systemd/system/blackBox_exporter.service -- 变成系统服务 netstat -anptu|grep 9115
[Unit]Description=blackBox_exporterAfter=network.target[Service]User=rootType=simpleExecStart=/usr/local/blackBox_exporter/blackBox_exporter --config.file=/usr/local/blackBox_exporter/blackBox.ymlRestart=on-failure[Install]WantedBy=multi-user.target
3.监控web和端口状态
- job_name: web_status metrics_path: /probe params: module: [http_2xx] static_configs: - targets: [‘http://192.168.1.49:8080/‘] labels: instance: web_status group: web - targets: [‘https://www.baIDu.com/‘] labels: instance: baIDu_status group: baIDu relabel_configs: - source_labels: [__address__] target_label: __param_target - target_label: __address__ replacement: 127.0.0.1:9115 - job_name: ‘port_status‘ metrics_path: /probe params: module: [tcp_connect] static_configs: - targets: [‘192.168.1.49:8080‘] labels: instance: ‘port_status‘ group: ‘tcp‘ relabel_configs: - source_labels: [__address__] target_label: __param_target - target_label: __address__ replacement: 127.0.0.1:9115
4.dashboard -- 9665 和 7587
5.参考:https://blog.csdn.net/qq_43190337/article/details/100577728
总结以上是内存溢出为你收集整理的用Blackbox Exporter to Monitor web和端口全部内容,希望文章能够帮你解决用Blackbox Exporter to Monitor web和端口所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)