2008-11-20 17:47:44 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Plugin to monitor yum update activity
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
#
|
2018-08-02 02:03:42 +02:00
|
|
|
# config
|
|
|
|
# autoconf
|
2008-11-20 17:47:44 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
|
|
if [ -r /var/log/yum.log ]; then
|
2018-08-02 02:03:42 +02:00
|
|
|
echo yes
|
2008-11-20 17:47:44 +01:00
|
|
|
else
|
|
|
|
echo "no (/var/log/yum.log not readable)"
|
|
|
|
fi
|
2018-09-16 04:01:57 +02:00
|
|
|
exit 0
|
2008-11-20 17:47:44 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
|
|
|
|
echo 'graph_title Yum Activity'
|
|
|
|
echo 'graph_args --base 1000 -l 0 '
|
2017-02-22 19:09:05 +01:00
|
|
|
echo 'graph_category security'
|
2008-11-20 17:47:44 +01:00
|
|
|
echo 'graph_vlabel Yum Activity'
|
|
|
|
echo 'updates.label Yum Updated'
|
|
|
|
echo 'updates.draw AREA'
|
|
|
|
echo 'installed.label Yum Installed'
|
|
|
|
echo 'installed.draw AREA'
|
|
|
|
echo 'erased.label Yum Erased'
|
|
|
|
echo 'erased.draw AREA'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -n "updates.value "
|
|
|
|
grep "`date "+%b %d"`" /var/log/yum.log | grep -ci Updated
|
|
|
|
|
|
|
|
echo -n "installed.value "
|
|
|
|
grep "`date "+%b %d"`" /var/log/yum.log | grep -ci Installed
|
|
|
|
|
|
|
|
echo -n "erased.value "
|
|
|
|
grep "`date "+%b %d"`" /var/log/yum.log | grep -ci Erased
|