1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

[plugins/dovecot/dovecot] make 'connected users' graph DERIVEable

This commit is contained in:
pcy 2020-07-18 02:42:27 +02:00 committed by Lars Kruse
parent 06919f1801
commit a1cff256cd

View file

@ -8,6 +8,7 @@
# Contributions by:
# - Stephane Enten <tuf@delyth.net>
# - Steve Schnepp <steve.schnepp@pwkf.org>
# - pcy <pcy@ulyssis.org> (make 'Connected Users' DERIVE, check existence of logfile in autoconf)
#
# Parameters understood:
#
@ -16,7 +17,7 @@
#
# Config variables:
#
# logfile - Where to find the syslog file
# logfile - Where to find the syslog file
#
# Add the following line to a file in /etc/munin/plugin-conf.d:
# env.logfile /var/log/your/logfile.log
@ -34,7 +35,7 @@ LOGFILE=${logfile:-/var/log/mail.log}
######################
if [ "$1" = "autoconf" ]; then
echo yes
[ -f "$LOGFILE" ] && echo yes || echo "no (logfile $LOGFILE not found)"
exit 0
fi
@ -53,6 +54,7 @@ if [ "$1" = "config" ]; then
done
echo 'connected.label Connected Users'
echo "connected.type DERIVE"
exit 0
fi
@ -86,7 +88,7 @@ echo -n
echo -en "login_tls.value "
VALUE=$(egrep -c '[dovecot]?.*Login.*TLS' $LOGFILE)
if [ ! -z "$VALUE" ]; then
echo "$VALUE"
echo "$VALUE"
else
echo "0"
fi
@ -97,7 +99,7 @@ echo -n
echo -en "login_ssl.value "
VALUE=$(egrep -c '[dovecot]?.*Login.*SSL' $LOGFILE)
if [ ! -z "$VALUE" ]; then
echo "$VALUE"
echo "$VALUE"
else
echo "0"
fi
@ -108,7 +110,7 @@ echo -n
echo -en "login_imap.value "
VALUE=$(egrep -c '[dovecot]?.*imap.*Login' $LOGFILE)
if [ ! -z "$VALUE" ]; then
echo "$VALUE"
echo "$VALUE"
else
echo "0"
fi
@ -119,8 +121,9 @@ echo -n
echo -en "login_pop3.value "
VALUE=$(egrep -c '[dovecot]?.*pop3.*Login' $LOGFILE)
if [ ! -z "$VALUE" ]; then
echo "$VALUE"
echo "$VALUE"
else
echo "0"
fi
echo -n