修改prometheus配置
[root@devops-prometheus ~]# vim /usr/local/prometheus/prometheus.yml
- job_name: 'alarm-http-port_status'
metrics_path: /probe
params:
module: [tcp_connect]
static_configs:
- targets: ['172.24.10.195:28851', '172.24.10.196:28851']
labels:
instance: 'port_status'
group: 'port'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: 10.1.0.157:9115
检查配置文件
[root@devops-prometheus ~]# cd /usr/local/prometheus/
[root@devops-prometheus prometheus]# ./promtool check config prometheus.yml
Checking prometheus.yml
SUCCESS: 1 rule files found
SUCCESS: prometheus.yml is valid prometheus config file syntax
Checking first_rules.yml
SUCCESS: 1 rules found
[root@devops-prometheus prometheus]# systemctl restart prometheus
评论