Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Ansible
Commits
3c2f218a
Verified
Commit
3c2f218a
authored
5 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
Warn when autoremove is possible
parent
feadda6f
No related branches found
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/prometheus-node-exporter/files/apt.sh
+2
-6
2 additions, 6 deletions
roles/prometheus-node-exporter/files/apt.sh
roles/prometheus/templates/prometheus/alert.rules.yml.j2
+8
-0
8 additions, 0 deletions
roles/prometheus/templates/prometheus/alert.rules.yml.j2
with
10 additions
and
6 deletions
roles/prometheus-node-exporter/files/apt.sh
+
2
−
6
View file @
3c2f218a
...
...
@@ -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{print
f
"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'
...
...
This diff is collapsed.
Click to expand it.
roles/prometheus/templates/prometheus/alert.rules.yml.j2
+
8
−
0
View file @
3c2f218a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment