2 # Copyright (C) 2012 Equinox Software, Inc.
\r
3 # Written by Michael Tate <mtate@esilibrary.com>
\r
5 # This program is free software; you can redistribute it and/or
\r
6 # modify it under the terms of the GNU General Public License
\r
7 # as published by the Free Software Foundation; either version 2
\r
8 # of the License, or (at your option) any later version.
\r
10 # This program is distributed in the hope that it will be useful,
\r
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 # GNU General Public License for more details.
\r
16 # Author : Michael Tate, Sys Admin, ESI
\r
17 # Purpose : Check number of DISABLED pound forwarders
\r
18 USAGE="check_pound_rotation (WARN if 1 brick, CRIT if 2 or more)"
\r
19 if [[ $1 == *help* ]]; then
\r
20 echo "Usage: $USAGE"
\r
25 PCOUNT=`sudo poundctl -c /var/run/pound/poundctl.socket | grep -c DISABLED`
\r
26 PDETAIL=`sudo poundctl -c /var/run/pound/poundctl.socket | grep DISABLED |cut -d":" -f1|cut -c18-|sort|uniq`
\r
28 if [[ $1 == *help* ]]; then
\r
29 echo "Usage: $USAGE"
\r
31 if [ $PCOUNT -gt 0 ]; then
\r
32 EXITSTATUS="WARN: $PCOUNT Services disabled; "
\r
34 elif [ $PCOUNT -gt 2 ]; then
\r
35 EXITSTATUS="CRIT: $PCOUNT Services disabled; "
\r
37 elif [ $PCOUNT -lt 1 ]; then
\r
38 EXITSTATUS="OK: $PCOUNT Services disabled."
\r