groups:
- name: Nginx
  rules:
  - alert: "Nginx离线"
    expr: nginx_up==0
    for: 0m
    labels:
      severity: critical
    annotations:
      summary: "Nginx离线"
      description: "Nginx离线,请查看文件服务器状态"

  - alert: "Nginx高活跃连接数"
    expr: nginx_connections_active > 500
    for: 2m
    labels:
      severity: warning
    annotations:
      summary: "Nginx高活跃连接数"
      description: "当前活跃连接数为 {{ $value }}"

  - alert: "Nginx请求量激增"
    expr: round(irate(nginx_http_requests_total[5m]), 0.01) > 1000
    for: 2m
    labels:
      severity: warning
    annotations:
      summary: "Nginx请求量激增"
      description: "Nginx 每秒请求量超过 1000，当前值为 {{ $value }}。可能是流量激增或恶意请求。"

