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.

APC UPS logoAPC UPS Prometheus Alert Rules

8 Prometheus alerting rules for APC UPS.Exported via mdlayher/apcupsd_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/apc-ups/apcupsd_exporter.yml
critical

13.1.1.APC UPS daemon down

apcupsd is unreachable from the exporter on {{ $labels.instance }}

  # apcupsd_exporter answers HTTP 500 when it cannot reach apcupsd, so up drops to 0.
  # Replace job="apcupsd" with the actual job name in your Prometheus configuration.
- alert: ApcUpsDaemonDown
  expr: 'up{job="apcupsd"} == 0'
  for: 5m
  labels:
    severity: critical
  annotations:
    summary: APC UPS daemon down (instance {{ $labels.instance }})
    description: "apcupsd is unreachable from the exporter on {{ $labels.instance }}\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

13.1.2.APC UPS daemon flapping

APC UPS daemon 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="apcupsd" with the actual job name in your Prometheus configuration.
- alert: ApcUpsDaemonFlapping
  expr: 'changes(up{job="apcupsd"}[10m]) >= 4'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: APC UPS daemon flapping (instance {{ $labels.instance }})
    description: "APC UPS daemon on {{ $labels.instance }} changed state {{ $value | printf \"%.0f\" }} times in the last 10 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

13.1.3.APC UPS low battery voltage

Battery voltage is lower than nominal (< 95%)

- alert: ApcUpsLowBatteryVoltage
  expr: '(apcupsd_battery_volts / apcupsd_battery_nominal_volts) < 0.95 and apcupsd_battery_nominal_volts > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: APC UPS low battery voltage (instance {{ $labels.instance }})
    description: "Battery voltage is lower than nominal (< 95%)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

13.1.4.APC UPS high temperature

Internal temperature is high ({{$value}}°C)

- alert: ApcUpsHighTemperature
  expr: 'apcupsd_internal_temperature_celsius >= 40'
  for: 2m
  labels:
    severity: warning
  annotations:
    summary: APC UPS high temperature (instance {{ $labels.instance }})
    description: "Internal temperature is high ({{$value}}°C)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

13.1.5.APC UPS Battery nearly empty

Battery is almost empty (< 10% left)

- alert: ApcUpsBatteryNearlyEmpty
  expr: 'apcupsd_battery_charge_percent < 10'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: APC UPS Battery nearly empty (instance {{ $labels.instance }})
    description: "Battery is almost empty (< 10% left)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

13.1.6.APC UPS Less than 15 Minutes of battery time remaining

Battery is almost empty (< 15 Minutes remaining)

- alert: ApcUpsLessThan15MinutesOfBatteryTimeRemaining
  expr: 'apcupsd_battery_time_left_seconds < 900'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: APC UPS Less than 15 Minutes of battery time remaining (instance {{ $labels.instance }})
    description: "Battery is almost empty (< 15 Minutes remaining)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

13.1.7.APC UPS AC input outage

UPS now running on battery (since {{$value | humanizeDuration}})

- alert: ApcUpsAcInputOutage
  expr: 'apcupsd_battery_time_on_seconds > 0'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: APC UPS AC input outage (instance {{ $labels.instance }})
    description: "UPS now running on battery (since {{$value | humanizeDuration}})\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

13.1.8.APC UPS high load

UPS load is > 80%

- alert: ApcUpsHighLoad
  expr: 'apcupsd_ups_load_percent > 80'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: APC UPS high load (instance {{ $labels.instance }})
    description: "UPS load is > 80%\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.