diff -r 8eaecffd197a -r 127a8c6d6e72 check_exiwhat.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/check_exiwhat.sh Wed Dec 19 22:36:00 2007 +0000 @@ -0,0 +1,29 @@ +#! /bin/bash +PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin +EXIM=$(command -v exim4 || command -v exim) + +smtp_accept_max=$(set -- $($EXIM -bP smtp_accept_max); echo $3) +warn=$((smtp_accept_max * 7 / 10)) +crit=$smtp_accept_max + +tmp=$(getopt -n $0 -o w:c: -- "$@") +eval set -- $tmp + +while : +do + opt="$1"; shift + case "$opt" in + -w) warn="$1"; shift;; + -c) crit="$1"; shift;; + --) break;; + esac +done + +r=$(($(exiwhat | wc -l) -1 )) +p="connections=$r;$warn;$crit" + + +test $r -gt $crit && { echo "CRIT ($r connections)|$p"; exit 2; } +test $r -gt $warn && { echo "WARN ($r connections)|$p"; exit 1; } +echo "OK ($r connections)|$p" +exit 0