2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/freebsd-upgrades
Manuel Schneider d1b9cbbb90 pretty simple plugin to monitor pending freebsd-updates
requires 'portversion'
2012-02-10 08:31:56 +08:00

38 lines
940 B
Bash
Executable file

#!/usr/local/bin/bash
if [ "$1" = "config" ]; then
echo "graph_title Available Updates"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel upgradeable packages/ports "
echo "pkg.label binary packages"
echo "ports.label ports"
exit 0
fi
if [ "$1" = "autoconf" ]; then
echo "yes"
exit 0
fi
updates="$(freebsd-update fetch | \
grep -v 'Looking up update.FreeBSD.org mirrors' | \
grep -v 'Fetching metadata signature' | \
grep -v 'Fetching metadata index' | \
grep -v 'Inspecting system' | \
grep -v 'Preparing to download files' | \
grep -v -e '^$' | \
grep -v 'The following files will be added' | \
grep -v 'No updates needed' | \
grep -v 'The following files will be updated' | wc -l | sed -e 's/ //g' )"
updates="$(echo -n "${updates}")"
echo "pkg.value $updates"
updates="$(portversion | grep '<' | wc -l | sed -e 's/ //g')"
updates="$(echo -n "${updates}")"
echo "ports.value $updates"
exit 0