2017-02-17 15:14:51 +01:00
|
|
|
#!/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.
|
|
|
|
|
|
|
|
=head1 INTERPRETATION
|
|
|
|
|
|
|
|
This plugin will draw one line: the number of updates pending.
|
|
|
|
|
|
|
|
=head1 MAGIC MARKERS
|
|
|
|
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
=head1 VERSION
|
|
|
|
|
2017-10-03 11:08:25 +02:00
|
|
|
1.1.0
|
2017-02-17 15:14:51 +01:00
|
|
|
|
|
|
|
=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
|
|
|
|
;;
|
|
|
|
|
|
|
|
autoconf)
|
|
|
|
hash checkupdates &> /dev/null && echo yes || echo "no (checkupdates not found)"
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2017-10-05 11:28:15 +02:00
|
|
|
updates="$(checkupdates)"
|
|
|
|
if [ -n "$updates" ]; then
|
|
|
|
echo "updates.value $(echo "$updates" | wc -l)"
|
|
|
|
echo "updates.extinfo $(echo "$updates" | paste -s -d,)"
|
|
|
|
else
|
|
|
|
echo updates.value 0
|
2017-10-03 11:08:25 +02:00
|
|
|
fi
|
2017-02-17 15:14:51 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|