mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Merge pull request #799 from bertptrs/plugin-pacman
Add a plugin for the pacman package manager.
This commit is contained in:
commit
c67c3d9298
1 changed files with 70 additions and 0 deletions
70
plugins/other/pacman_pending_updates
Executable file
70
plugins/other/pacman_pending_updates
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
|
||||
: <<=cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pacman_pending_updates - Plugin to monitor pending updates
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
All systems with pacman as their package manager.
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
The plugin needs no additional configuration and works out of the box.
|
||||
|
||||
It is possible to add warnings for certain numbers of updates pending. The
|
||||
following will send a warning when there are more than 10 updates pending.
|
||||
|
||||
[pacman_pending_updates]
|
||||
env.PENDING_UPDATES_WARNING :10
|
||||
|
||||
=head1 INTERPRETATION
|
||||
|
||||
This plugin will draw one line: the number of updates pending.
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
1.0.0
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Bert Peters <bert@bertptrs.nl>
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=cut
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_args --base 1000 -l 0
|
||||
graph_title Pending updates
|
||||
graph_vlabel updates
|
||||
graph_category security
|
||||
updates.label updates
|
||||
updates.info Current number of pending updates
|
||||
EOM
|
||||
if [[ -n $PENDING_UPDATES_WARNING ]]; then
|
||||
echo updates.warning $PENDING_UPDATES_WARNING
|
||||
fi
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
hash checkupdates &> /dev/null && echo yes || echo "no (checkupdates not found)"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo updates.value $(checkupdates | wc -l)
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue