zoukankan      html  css  js  c++  java
  • 监控ssl证书到期时间

    [root@iZbp1a16m3y5y71tdh7isyZ config]# cat prometheus.yml

    ····  
      - job_name: 'blackbox_http_2xx'
          scrape_interval: 30s
          metrics_path: /probe
          params:
            module: [http_2xx]
          static_configs:
            - targets:
              - https://xxxxxxxxxxxx
          relabel_configs:
            - source_labels: [__address__]
              target_label: __param_target
            - source_labels: [__param_target]
              target_label: instance
            - target_label: __address__
              replacement: blackbox-exporter:9115
    

    [root@iZbp1a16m3y5y71tdh7isyZ rules]# cat blackbox_rules.yaml

    groups:
    - name: ssl_expiry
      rules:
      - alert: Ssl Cert Will Expire in 30 days
        expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 30
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: "SSL certificate will expire soon on (instance {{ $labels.instance }})"
          description: "https 证书还剩 30 days\n  VALUE = {{ $value }}\n  LABELS: {{ $labels }}"
    
  • 相关阅读:
    css
    Git使用
    Github入门
    flask框架预备知识
    django框架预备知识
    JSON格式
    盒模型详解
    position属性详解
    float属性详解
    display属性详解
  • 原文地址:https://www.cnblogs.com/Applogize/p/15529626.html
Copyright © 2011-2022 走看看