监控相关
ZABBIX安装与使用
自动发现与自动注册
配置文件
分布式监控
zabbix_sender安装和使用
zabbix_get安装与使用
自定义监控
自动发现监控json
PERCONA插件
PERCONA多实例
日志监控
相关项目监控
监控MySQL
监控Haproxy
Fluentd日志监控
Grafana(可视化监控指标)
grafana地图插件
添加prometheus模板
开启HTTPS
添加zabbix插件
Grafana模板
正则表达式
Prometheus监控
安装与使用
Prometheus存储
服务发现
Prometheus标签
PromQL查询
PushGateway推送组件
AlertManager告警组件
告警规则rule
K8S监控(kube-state-metric/cadvisor)
探针监控(blackbox_exporter)
Node_export
Mysql_export
Redis-exporter
cloudeye-exporter【华为云监控】
RabbitMQ-exporter
K8S监控
本文档使用MrDoc发布
返回首页
-
+
探针监控(blackbox_exporter)
2021年6月8日 16:16
admin
#安装 wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.19.0/blackbox_exporter-0.19.0.linux-amd64.tar.gz tar -zxvf blackbox_exporter-0.19.0.linux-amd64.tar.gz mkdir -p /usr/local/exporter/ mv blackbox_exporter-0.19.0.linux-amd64 /usr/local/exporter/blackbox_exporter #启动EXPORTER cd /usr/local/exporter/blackbox_exporter ./blackbox_exporter #前台启动 nohup ./blackbox_exporter & #后台启动 ----------------------------------------------------------- --web.listen-address=":9100" #blackbox_exporter监听的端口,默认是9100,若需要修改则通过此参数。 --web.telemetry-path="/metrics" #获取metric信息的url,默认是/metrics,若需要修改则通过此参数 --log.level="info" #设置日志级别 --log.format="logger:stderr" #设置打印日志的格式,若有自动化日志提取工具可以使用这个参数规范日志打印的格式 #Prometheus配置 ###icmp测试(监控主机存活状态) vim prometheus.yml #内容: - job_name: node_status metrics_path: /probe params: module: [icmp] static_configs: - targets: ['10.165.94.31'] labels: instance: node_status group: 'node' relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 172.19.155.133:9115 ###tcp测试(监控主机端口存活状态) vim prometheus.yml #内容: - job_name: 'prometheus_port_status' metrics_path: /probe params: module: [tcp_connect] static_configs: - targets: ['172.19.155.133:8765'] labels: instance: 'port_status' group: 'tcp' relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 172.19.155.133:9115 ###http测试(监控网站状态) vim prometheus.yml #内容: - job_name: web_status metrics_path: /probe params: module: [http_2xx] static_configs: - targets: ['http://www.baidu.com'] labels: instance: user_status group: 'web' relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 172.19.155.133:9115 ###post测试(接口联通性) - job_name: 'blackbox_http_2xx_post' scrape_interval: 10s metrics_path: /probe params: module: [http_post_2xx_query] static_configs: - targets: - https://xx.xxx.com/api/xx/xx/fund/query.action labels: group: 'Interface monitoring' relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: 172.19.155.133:9115 #grafana添加监控模板 模板id 9965 #参考资料 https://www.cnblogs.com/xiao987334176/p/12022482.html https://blog.csdn.net/qq_25934401/article/details/84325356
分享到: