#!/bin/bash QueueDir=`grep StoreDir /opt/kerio/mailserver/mailserver.cfg | cut -d ">" -f 2 | cut -d "<" -f 1`/queue warn=10 critical=20 count=`find $QueueDir -type f -name "*.eml" | wc -l` item="Kerio_Mailqueue" status=0 text="OK" if [ $count -gt $warn ]; then status=1 text="WARNING" fi if [ $count -gt $critical ]; then status=2 text="CRITICAL" fi echo "$status $item count=$count;$warn;$critical;0 $text - $count mails in queue"