Skip to main content
APA
Sponsored byCAST AI — Kubernetes cost optimizationBetter Stack — Uptime monitoring and log managementVictoriaMetrics — Fast, open-source time series database and drop-in Prometheus replacement.

VMware logoVMware Prometheus Alert Rules

6 Prometheus alerting rules for VMware.Exported via pryorda/vmware_exporter.These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/vmware/pryorda-vmware-exporter.yml
critical

1.9.1.VMware API down

VMware exporter failed to collect from vCenter/ESXi on {{ $labels.instance }}

  # vmware_exporter answers HTTP 500 when collection fails, so up drops to 0 when vCenter/ESXi is unreachable.
  # Replace job="vmware" with the actual job name in your Prometheus configuration.
- alert: VmwareApiDown
  expr: 'up{job="vmware"} == 0'
  for: 5m
  labels:
    severity: critical
  annotations:
    summary: VMware API down (instance {{ $labels.instance }})
    description: "VMware exporter failed to collect from vCenter/ESXi on {{ $labels.instance }}\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

1.9.2.VMware API flapping

VMware API on {{ $labels.instance }} changed state {{ $value | printf "%.0f" }} times in the last 10 minutes.

  # Catches a crash-looping service, which the down rule misses because each successful scrape resets its for: timer.
  # 4 changes means at least 2 down/up cycles in 10m; one outage followed by a recovery counts only 2.
  # Replace job="vmware" with the actual job name in your Prometheus configuration.
- alert: VmwareApiFlapping
  expr: 'changes(up{job="vmware"}[10m]) >= 4'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: VMware API flapping (instance {{ $labels.instance }})
    description: "VMware API on {{ $labels.instance }} changed state {{ $value | printf \"%.0f\" }} times in the last 10 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

1.9.3.Virtual Machine Memory Critical

High memory usage on {{ $labels.instance }}: {{ $value | printf "%.2f"}}%

- alert: VirtualMachineMemoryCritical
  expr: 'vmware_vm_mem_usage_average / 100 >= 95'
  for: 10m
  labels:
    severity: critical
  annotations:
    summary: Virtual Machine Memory Critical (instance {{ $labels.instance }})
    description: "High memory usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\"}}%\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

1.9.4.Virtual Machine Memory Warning

High memory usage on {{ $labels.instance }}: {{ $value | printf "%.2f"}}%

- alert: VirtualMachineMemoryWarning
  expr: 'vmware_vm_mem_usage_average / 100 >= 90 and vmware_vm_mem_usage_average / 100 < 95'
  for: 10m
  labels:
    severity: warning
  annotations:
    summary: Virtual Machine Memory Warning (instance {{ $labels.instance }})
    description: "High memory usage on {{ $labels.instance }}: {{ $value | printf \"%.2f\"}}%\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

1.9.5.High Number of Snapshots

High snapshots number on {{ $labels.instance }}: {{ $value }}

  # 3 snapshots is a rough default; how many snapshots are reasonable depends on your backup/retention policy — adjust based on your workflow.
- alert: HighNumberOfSnapshots
  expr: 'vmware_vm_snapshots > 3'
  for: 30m
  labels:
    severity: warning
  annotations:
    summary: High Number of Snapshots (instance {{ $labels.instance }})
    description: "High snapshots number on {{ $labels.instance }}: {{ $value }}\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

1.9.6.Outdated Snapshots

Outdated snapshots on {{ $labels.instance }}: {{ $value | printf "%.0f"}} days

  # 7 days is a rough default; how long a snapshot should live depends on your backup/retention policy — adjust based on your workflow.
- alert: OutdatedSnapshots
  expr: '(time() - vmware_vm_snapshot_timestamp_seconds) / (60 * 60 * 24) >= 7'
  for: 5m
  labels:
    severity: warning
  annotations:
    summary: Outdated Snapshots (instance {{ $labels.instance }})
    description: "Outdated snapshots on {{ $labels.instance }}: {{ $value | printf \"%.0f\"}} days\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"

Share your alerting rules

Your production alerts can make this collection better. Share your rule files in one command: only Prometheus rule files and PrometheusRule resources are uploaded, while prometheus.yml, alertmanager.yml and other configurations are skipped, as they often contain credentials.

npx awesome-prometheus-alerts share /etc/prometheus/rules

Add --dry-run to preview what would be sent.