#!/bin/sh
#
# qtop -- kleine Auslastungsanzeige für Postfix
# Heinlein Professional Linux Support GmbH
#
, 26.6.08
#
# Geschrieben für das Postfix-Buch
# http://www.postfixbuch.de
#
# find kann sich u.U. über zwischenzeitlich gelöschte Maildateien
# in der Queue aufregen, was die Anzeige zerstört -- darum ist
# "2>/dev/null" wichtig.
#
# Über "-n " wird gesteuert, nach wievielen Sekunden sich
# die Anzeige aktualisiert.
#
watch -n 5 "
echo
echo
echo ' *** qtop -- Monitoring Postfix (1.0) ***'
echo ' Peer Heinlein '
echo ' Das Postfix-Buch - http://www.postfixbuch.de'
echo
echo
echo -n ' Anzahl Mails in maildrop..: '
find /var/spool/postfix/maildrop -type f 2>/dev/null | wc -l
echo -n ' Anzahl Mails in incoming..: '
find /var/spool/postfix/incoming -type f 2>/dev/null | wc -l
echo -n ' Anzahl Mails in active....: '
find /var/spool/postfix/active -type f 2>/dev/null | wc -l
echo -n ' Anzahl Mails in deferred..: '
find /var/spool/postfix/deferred -type f 2>/dev/null | wc -l
echo -n ' Anzahl Mails in hold......: '
find /var/spool/postfix/hold -type f 2>/dev/null | wc -l
echo
echo
echo -n ' Anzahl Prozesse smtpd.....: '
ps ax | grep "smtpd -n" | wc -l
echo -n ' Anzahl Prozesse smtp......: '
ps ax | grep "smtp -n" | wc -l
echo
echo
echo ' Ende mit STRG-C.'
"