Commit 40bc5d20 authored by Ferenc Wágner's avatar Ferenc Wágner
Browse files

Initial import

parents
#!/bin/sh
set -e
exec 2>&1
RETVAL=3
trap 'exit $RETVAL' 0
# membership reminders tend to pile up
dom=$(date +%d)
if [ "$dom" -le 1 ]; then
warn=300
crit=400
else
warn=200
crit=300
fi
set -- $(/usr/sbin/exiqgrep -zc)
frozen=$1
all=$5
if [ $frozen -gt 0 -o $all -gt $crit ]; then
RETVAL=2
else if [ $all -gt $warn ]; then
RETVAL=1
else
RETVAL=0
fi
fi
echo "$frozen frozen messages out of $all queued"
#!/bin/sh
set -e
exec 2>&1
RETVAL=3
trap 'exit $RETVAL' 0
WARN=1
CRIT=5
OLD=5 # minutes
QUEUEDIR=/var/lib/mailman/qfiles
for q in archive bounces commands in news out retry shunt; do
COUNT=$(find $QUEUEDIR/$q -type f -mmin +$OLD | wc -l)
SUM=$(($SUM+$COUNT))
[ "$COUNT" -gt 0 ] && MSG="$MSG $q:$COUNT"
done
TEXT="old queued message"
case "$SUM" in
0) SUMMARY="no ${TEXT}s";;
1) SUMMARY="$SUM $TEXT (${MSG# })";;
*) SUMMARY="$SUM ${TEXT}s (${MSG# })";;
esac
if [ "$SUM" -ge $CRIT ]; then
RETVAL=2
elif [ "$SUM" -ge $WARN ]; then
RETVAL=1
else
RETVAL=0
fi
case "$RETVAL" in
2) STATE="CRITICAL";;
1) STATE="WARNING";;
0) STATE="OK";;
*) STATE="INCONSISTENT";;
esac
echo "$STATE: $SUMMARY"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment