Sindbad~EG File Manager

Current Path : /lib64/nagios/plugins/
Upload File :
Current File : //lib64/nagios/plugins/check_mailscanner_queue

#!/bin/bash

#
# MAILSCANNER CHECK QUEUES
#
# Usage ./check_mailscanner_queue.sh {WARN} {CRIT} eg. ./check_mailscanner_queue 350 500
#
if [ $1 -gt $2 ] ; then
        echo "WARNING - PARAMETERS INCORRECT"
        echo "Usage ./check_mailscanner_queue.sh {WARN} {CRIT} eg. ./check_mailscanner_queue 350 500"
        exit 4
fi
if [ -e /etc/exim_outgoing.conf ] ; then
	ARGS="-C /etc/exim_outgoing.conf -bpc"
else
	ARGS="-bpc"
fi
CMD=`which exim` 
NUM=`$CMD $ARGS`

if [ "$NUM" -gt "$2" ] ; then
        echo "CRITICAL - Currently $NUM mails in queue."
        exit 2
elif [ "$NUM" -gt "$1" ] ; then
        echo "WARNING - Currently $NUM mails in queue."
        exit 1
else
        echo "OK - Currently $NUM mails in queue."
        exit 0
fi

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists