Révision 1f77869d
Fixed some typos, allowed overriding of
| plugins/other/postfix_mail_stats | ||
|---|---|---|
| 1 |
#!/usr/local/bin/bash
|
|
| 1 |
#!/bin/bash |
|
| 2 | 2 |
# |
| 3 | 3 |
# Made by Boudewijn Ector, for Boudewijn Ector IT. |
| 4 | 4 |
# Comments can be sent to (boudewijn<AT>boudewijnector'dot'NL) |
| 5 | 5 |
# Loosely based on http://munin.projects.linpro.no/attachment/wiki/PluginCat/postfix_messages_hourly.txt |
| 6 | 6 |
# Script to show postfix stuff |
| 7 | 7 |
# |
| 8 |
# Modified by Paul Saunders <darac+munin@darac.org.uk>, 10 Dec 2010 |
|
| 9 |
# |
|
| 8 | 10 |
# Parameters understood: |
| 9 | 11 |
# |
| 10 | 12 |
# config (required) |
| ... | ... | |
| 18 | 20 |
#%# capabilities=autoconf |
| 19 | 21 |
|
| 20 | 22 |
|
| 21 |
LOGFILE=/var/log/maillog
|
|
| 23 |
LOGFILE=${logfile:-/var/log/maillog} # Allow user to specify logfile through env.logfile
|
|
| 22 | 24 |
DATE=`date '+%b %e %H'` |
| 23 | 25 |
MAXLABEL=20 |
| 24 | 26 |
|
| 25 | 27 |
if [ "$1" = "autoconf" ]; then |
| 26 |
echo yes |
|
| 28 |
if [[ -r $LOGFILE ]]; then |
|
| 29 |
echo yes |
|
| 30 |
else |
|
| 31 |
echo no |
|
| 32 |
fi |
|
| 27 | 33 |
exit 0 |
| 28 | 34 |
fi |
| 29 | 35 |
|
| ... | ... | |
| 43 | 49 |
fi |
| 44 | 50 |
|
| 45 | 51 |
echo -en "recieved.value " |
| 46 |
echo $(grep "status=sent (delivered to maildir)" $LOGFILE | grep "$DATE" | wc -l)
|
|
| 52 |
echo $(grep "status=sent (delivered" $LOGFILE | grep "$DATE" | wc -l) |
|
| 47 | 53 |
echo -n |
| 48 | 54 |
echo -en "sent.value " |
| 49 | 55 |
echo $(grep "status=sent (250" $LOGFILE | grep "$DATE" | wc -l) |
| 50 | 56 |
echo -en "rejecthelo.value " |
| 51 |
echo $(grep "Helocommand rejected: need fully-qualified hostname" $LOGFILE | grep "$DATE" | wc -l) |
|
| 57 |
echo $(grep "Helo command rejected: need fully-qualified hostname" $LOGFILE | grep "$DATE" | wc -l)
|
|
| 52 | 58 |
echo -en "rejectsenderdomain.value " |
| 53 | 59 |
echo $(grep "Sender address rejected: Domain not found" $LOGFILE | grep "$DATE" | wc -l) |
| 54 | 60 |
|
Formats disponibles : Unified diff