prometheus监控端口

DevOps Prometheus评论1,112字数 722阅读2分24秒阅读模式

修改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

 

DevOps
  • 本文由 发表于 2022年11月30日 14:44:27
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
prometheus告警规则 Prometheus

prometheus告警规则

基础监控 主机内存不足 节点内存已满(剩余 < 10%) groups: - name: Node memory is filling up (< 10% left) rul...
Prometheus服务发现 Prometheus

Prometheus服务发现

介绍 Prometheus 提供了服务发现机制,即通过自动化的机制来检测、分类和识别新的和变更的目标。一般有这几种类型:静态、基于文件、基于API、基于DNS。 基于文件的服务发现 基于...
评论  0  访客  0

发表评论