oli@netcup ~ $ date
Friday, May 4th, 2007
oli@netcup ~ $ echo Postfix queue ÜberwachnungPostfix queue Überwachnung
Da Postfix ja leider nicht immer so 100% rund läuft habe ich mir kurzerhand ein kleines Skript gebaut, welches mir die Länge der Mailqueue mit Status deferred überwacht:
Als erstes muss man sich die Postfix sources besorgen:
cd /root
mkdir postfix
apt-get source postfix
und dann ein kleines Skript bauen:
/root/mailmonitoring.sh
#!/bin/sh
defmail=`perl /root/postfix/postfix-2.3.8/auxiliary/qshape/qshape.pl deferred | grep TOTAL | awk '{print $2 }'`
if [ 100 -lt $defmail ]
then
echo "Attention deferred Mail greater then 100: $defmail" | mail -s "problem" mail@domain.tld
fi
Nur noch mail@domain.tld anpassen und eventuell auch die Zahl 100 in der IF Abfrage
Noch nen kleinen crontab eintrag und dann läuft das minütlich.
crontab -e
*/1 * * * * bash /root/mailmonitoring.sh
Speichern und fertig.
Viel Spaß damit und eine sichere Mailübermittlung.
oli@netcup ~ $ clear
3 comments
to Postfix queue Überwachnung
Leave a comment
oli@netcup ~ $

on Sunday, July 8th, 2007 at 2:29 pm:
[...]
if [ 100 -lt $defmail ]
[...]
on Friday, July 13th, 2007 at 11:34 am:
thanks for the comment :)
just edit it
on Friday, July 13th, 2007 at 1:29 pm:
Anstatt */1 tut es in der crontab auch nur ein * :-)
Gruss,
Marcel.