#!/bin/bash
OS=$(uname -o)
PID=$$
TEST="postqueue"
VERSION='1.2'
VERMSG="
Version: ${VERSION}"
DATE=$(date)
POSTQ='/usr/sbin/postqueue'
pq=$(${POSTQ} -p)
cnt=$(${POSTQ} -p | tail -1 | cut -d' ' -f5)
if [[ "X" == "X${cnt}" ]]
then
color="green"
else
cnt1=$(${POSTQ} -p | grep '^[0-9A-Z]' | wc -l)
if (( 0 == cnt1 ))
then
color="green"
else
if (( 100 > cnt1 ))
then
color="yellow"
else
color="red"
fi
fi
fi
# echo ${BB} ${BBDISP} "status ${MACHINE}.${TEST} ${color} ${pq}"
${BB} ${BBDISP} "status ${MACHINE}.${TEST} ${color} ${DATE} ${pq} ${VERMSG}"