1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

mail/postfix_stats: convert to unix line endings

This commit is contained in:
Kenyon Ralph 2013-11-03 01:20:42 -07:00
parent 17c0715a26
commit fe76476933

View file

@ -1,52 +1,52 @@
#!/bin/sh
#
# Plugin to show Postfix statistics - needs pflogsumm
#
# Contributed by David Obando (david@cryptix.de) - 16.04.2007
#
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=manual
#%# capabilities=autoconf
#set -xv
case $1 in
config)
cat <<'EOF'
system.type COUNTER
graph_title Postfix statistics
graph_vlabel Postfix statistics
graph_category Mail
graph_total Total
received.label received
delivered.label delivered
forwarded.label forwarded
deferred.label deferred
bounced.label bounced
rejected.label rejected
held.label held
discarded.label discarded
EOF
exit 0;;
esac
TMP=`mktemp /tmp/tmp.XXXXXXXX`
pflogsumm.pl --smtpd_stats -d today /var/log/syslog /var/log/syslog.0 | head -n 15 > $TMP
cat <<EOF
received.value `grep 'received' $TMP | awk '{print $1}'`
delivered.value `grep 'delivered' $TMP | awk '{print $1}'`
forwarded.value `grep 'forwarded' $TMP | awk '{print $1}'`
deferred.value `grep 'deferred' $TMP | awk '{print $1}'`
bounced.value `grep 'bounced' $TMP | awk '{print $1}'`
rejected.value `grep 'rejected' $TMP | awk '{print $1}'`
held.value `grep 'held' $TMP | awk '{print $1}'`
discarded.value `grep 'discarded' $TMP | awk '{print $1}'`
EOF
rm $TMP
#!/bin/sh
#
# Plugin to show Postfix statistics - needs pflogsumm
#
# Contributed by David Obando (david@cryptix.de) - 16.04.2007
#
#
# Magic markers - optional - used by installation scripts and
# munin-config:
#
#%# family=manual
#%# capabilities=autoconf
#set -xv
case $1 in
config)
cat <<'EOF'
system.type COUNTER
graph_title Postfix statistics
graph_vlabel Postfix statistics
graph_category Mail
graph_total Total
received.label received
delivered.label delivered
forwarded.label forwarded
deferred.label deferred
bounced.label bounced
rejected.label rejected
held.label held
discarded.label discarded
EOF
exit 0;;
esac
TMP=`mktemp /tmp/tmp.XXXXXXXX`
pflogsumm.pl --smtpd_stats -d today /var/log/syslog /var/log/syslog.0 | head -n 15 > $TMP
cat <<EOF
received.value `grep 'received' $TMP | awk '{print $1}'`
delivered.value `grep 'delivered' $TMP | awk '{print $1}'`
forwarded.value `grep 'forwarded' $TMP | awk '{print $1}'`
deferred.value `grep 'deferred' $TMP | awk '{print $1}'`
bounced.value `grep 'bounced' $TMP | awk '{print $1}'`
rejected.value `grep 'rejected' $TMP | awk '{print $1}'`
held.value `grep 'held' $TMP | awk '{print $1}'`
discarded.value `grep 'discarded' $TMP | awk '{print $1}'`
EOF
rm $TMP