Warn when autoremove is possible
parent
feadda6fac
commit
3c2f218a2f
|
@ -16,7 +16,7 @@ upgrades="$(/usr/bin/apt-get --just-print dist-upgrade \
|
|||
)"
|
||||
|
||||
autoremove="$(/usr/bin/apt-get --just-print autoremove \
|
||||
| /usr/bin/awk '/^Remv/{a++}END{print "apt_autoremove_pending " a}'
|
||||
| /usr/bin/awk '/^Remv/{a++}END{printf "apt_autoremove_pending %d", a}'
|
||||
)"
|
||||
|
||||
echo '# HELP apt_upgrades_pending Apt package pending updates by origin.'
|
||||
|
@ -29,11 +29,7 @@ fi
|
|||
|
||||
echo '# HELP apt_autoremove_pending Apt package pending autoremove.'
|
||||
echo '# TYPE apt_autoremove_pending gauge'
|
||||
if [[ -n "${autoremove}" ]] ; then
|
||||
echo "${autoremove}"
|
||||
else
|
||||
echo 'apt_autoremove_pending 0'
|
||||
fi
|
||||
echo "${autoremove}"
|
||||
|
||||
echo '# HELP node_reboot_required Node reboot is required for software updates.'
|
||||
echo '# TYPE node_reboot_required gauge'
|
||||
|
|
|
@ -142,6 +142,14 @@ groups:
|
|||
summary: "La tension de sortie de {{ $labels.instance }} est de {{ $value }}V."
|
||||
description: "https://grafana.crans.org/d/qtbg59mZz/alimentation"
|
||||
|
||||
- alert: AptAutoremovePending
|
||||
expr: apt_autoremove_pending > 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: "{{ $value }} paquet(s) APT sont inutile(s) sur {{ $labels.instance }}."
|
||||
|
||||
# NTP (need NTP plugin in node)
|
||||
# - alert: ntp_drifting
|
||||
# expr: node_ntp_drift_seconds > 0.05
|
||||
|
|
Loading…
Reference in New Issue