首页 > 其他分享 >04常用告警规则

04常用告警规则

时间:2023-03-16 11:45:44浏览次数:43  
标签:node 04 labels value instance 规则 告警 CPU

1.cpu告警规则

groups:
- name: hostStatsAlert
  rules:
  - alert: hostCpuUsageAlert
# 正则匹配job中的node_exporter值,这里.匹配了单个数字
    expr: (1-(avg(irate(node_cpu_seconds_total{job=~"node_exporter.",mode="idle"}[5m])) by (instance)))*100 > 0.55
    for: 100s
    labels:
      severity: page
    annotations:
# {$..}调用prometheus ui界面的变量
      summary: "Instance {{ $labels.instance }} CPU usgae high"
      description: "{{ $labels.instance }} CPU usage above 55% (current value: {{ $value }})"

  

触发命令

cat /dev/zero > /dev/null

  

 

标签:node,04,labels,value,instance,规则,告警,CPU
From: https://www.cnblogs.com/chenzhi2023/p/17221728.html

相关文章