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.

Juniper logoJuniper Prometheus Alert Rules

4 Prometheus alerting rules for Juniper.Exported via czerwonk/junos_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/juniper/czerwonk-junos-exporter.yml
critical

9.4.1.Juniper switch down

The switch appears to be down

- alert: JuniperSwitchDown
  expr: 'junos_up == 0'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: Juniper switch down (instance {{ $labels.instance }})
    description: "The switch appears to be down\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.4.2.Juniper switch flapping

Juniper switch 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.
- alert: JuniperSwitchFlapping
  expr: 'changes(junos_up[10m]) >= 4'
  for: 0m
  labels:
    severity: critical
  annotations:
    summary: Juniper switch flapping (instance {{ $labels.instance }})
    description: "Juniper switch on {{ $labels.instance }} changed state {{ $value | printf \"%.0f\" }} times in the last 10 minutes.\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
critical

9.4.3.Juniper critical Bandwidth Usage 1GiB

Interface is highly saturated. (> 0.90GiB/s)

  # 0.90GiB/s assumes a ~1Gbps-class interface; adjust to match your interface's actual configured speed (use ifHighSpeed for 10G+ interfaces).
- alert: JuniperCriticalBandwidthUsage1gib
  expr: 'rate(junos_interface_transmit_bytes[1m]) * 8 > 1e+9 * 0.90'
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: Juniper critical Bandwidth Usage 1GiB (instance {{ $labels.instance }})
    description: "Interface is highly saturated. (> 0.90GiB/s)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

9.4.4.Juniper warning Bandwidth Usage 1GiB

Interface is getting saturated. (> 0.80GiB/s)

  # 0.80GiB/s assumes a ~1Gbps-class interface; adjust to match your interface's actual configured speed (use ifHighSpeed for 10G+ interfaces).
- alert: JuniperWarningBandwidthUsage1gib
  expr: 'rate(junos_interface_transmit_bytes[1m]) * 8 > 1e+9 * 0.80'
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: Juniper warning Bandwidth Usage 1GiB (instance {{ $labels.instance }})
    description: "Interface is getting saturated. (> 0.80GiB/s)\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.