1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-12 13:48:38 +00:00

Use simple quotes and better graph config

This commit is contained in:
Cristian Deluxe 2016-11-02 04:53:27 +01:00
parent 424b962e14
commit 918602cd00

View file

@ -28,7 +28,7 @@ PFLOGSUMM=${pflogsumm:-pflogsumm.pl}
#
# Autoconf Section
#
if [ "$1" = "autoconf" ]; then
if [ "$1" = 'autoconf' ]; then
# Try to find pflogsumm with default name
PFLOG_EXIST=$(command -v pflogsumm.pl)
@ -40,9 +40,9 @@ if [ "$1" = "autoconf" ]; then
if [[ -z "${PFLOG_EXIST}" ]]
then
echo "no";
echo 'no';
else
echo "yes"
echo 'yes'
fi
exit 0;
fi
@ -50,20 +50,36 @@ fi
#
# Config Section
#
if [ "$1" = "config" ]; then
echo "system.type COUNTER"
echo "graph_title Postfix statistics"
echo "graph_vlabel Postfix statistics"
echo "graph_category Mail"
echo "graph_total Total"
echo "received.label received"
echo "delivered.label delivered"
echo "forwarded.label forwarded"
echo "deferred.label deferred"
echo "bounced.label bounced"
echo "rejected.label rejected"
echo "held.label held"
echo "discarded.label discarded"
if [ "$1" = 'config' ]; then
echo 'graph_title Postfix statistics'
echo 'graph_vlabel Postfix statistics'
echo 'graph_category mail'
echo 'graph_scale no'
echo 'graph_total Total'
echo 'received.label received'
echo 'received.type DERIVE'
echo 'received.min 0'
echo 'delivered.label delivered'
echo 'delivered.type DERIVE'
echo 'delivered.min 0'
echo 'forwarded.label forwarded'
echo 'forwarded.type DERIVE'
echo 'forwarded.min 0'
echo 'deferred.label deferred'
echo 'deferred.type DERIVE'
echo 'deferred.min 0'
echo 'bounced.label bounced'
echo 'bounced.type DERIVE'
echo 'bounced.min 0'
echo 'rejected.label rejected'
echo 'rejected.type DERIVE'
echo 'rejected.min 0'
echo 'held.label held'
echo 'held.type DERIVE'
echo 'held.min 0'
echo 'discarded.label discarded'
echo 'discarded.type DERIVE'
echo 'discarded.min 0'
exit 0;
fi
@ -91,19 +107,19 @@ parseValue() {
}
# Print results
printf "received.value "
parseValue "received"
printf "delivered.value "
parseValue "delivered"
printf "forwarded.value "
parseValue "forwarded"
printf "deferred.value "
parseValue "deferred"
printf "bounced.value "
parseValue "bounced"
printf "rejected.value "
parseValue "rejected"
printf "held.value "
parseValue "held"
printf "discarded.value "
parseValue "discarded"
printf 'received.value '
parseValue 'received'
printf 'delivered.value '
parseValue 'delivered'
printf 'forwarded.value '
parseValue 'forwarded'
printf 'deferred.value '
parseValue 'deferred'
printf 'bounced.value '
parseValue 'bounced'
printf 'rejected.value '
parseValue 'rejected'
printf 'held.value '
parseValue 'held'
printf 'discarded.value '
parseValue 'discarded'