Add AptUpgradesPending alert

This commit is contained in:
Julian Rother 2024-04-18 01:42:58 +02:00
parent 17f40221b6
commit 4ffb1d7f2e
No known key found for this signature in database
GPG key ID: 8F9B6AE9BAAE4899
2 changed files with 16 additions and 1 deletions

View file

@ -260,3 +260,16 @@ prometheus_agent:
annotations:
title: '{%raw%}{{ $labels.instance }}: Uptime{%endraw%}'
description: "Uptime is more than 30 days, please reboot soon"
AptUpgradesPending:
group: nodeexporter
enabled: True
alert: UpgradesPending
expr: |
sum(apt_upgrades_pending{job="node", instance="{{ inventory_hostname }}"}) > 0 or
sum(apt_upgrades_held{job="node", instance="{{ inventory_hostname }}"}) > 0
for: 25h
labels:
severity: warning
annotations:
title: '{%raw%}{{ $labels.instance }}: AptUpgradesPending{%endraw%}'
description: "Upgrades pending for more than 24 hours"

View file

@ -1,6 +1,8 @@
- name: install node-exporter
apt:
pkg: prometheus-node-exporter
pkg:
- prometheus-node-exporter
- prometheus-node-exporter-collectors
- name: copy node-exporter config
notify: restart node-exporter