summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-02-14 16:25:54 +0100
committervarac <varacanero@zeromail.org>2014-02-14 16:25:54 +0100
commit126811e6c8f9fdf8bc5ff2c2c0277f1fa7dae83c (patch)
tree9b1fe40978435f681f45d09b9ede185eed59e8e6
parent26feb4a5b58badf97abd5fffffc8ebf6a0b341f3 (diff)
modified check_bigcouch_errors.sh output to be check_mk compatible
-rwxr-xr-xtests/check_bigcouch_errors.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/check_bigcouch_errors.sh b/tests/check_bigcouch_errors.sh
index 21cadb1..d14ab92 100755
--- a/tests/check_bigcouch_errors.sh
+++ b/tests/check_bigcouch_errors.sh
@@ -3,6 +3,11 @@
WARN=10
CRIT=20
+STATUS[0]='OK'
+STATUS[1]='Warning'
+STATUS[2]='Critical'
+CHECKNAME='Bigcouch_Log'
+
LOG='/opt/bigcouch/var/log/bigcouch.log'
# for debugging: zgrep through old logs
@@ -16,20 +21,17 @@ total=`echo -e "$errors" | grep -v '^$' | wc -l`
if [ $total -lt $WARN ]
then
- echo -n "OK"
exitcode=0
else
if [ $total -le $CRIT ]
then
- echo -n "Warning"
exitcode=1
else
- echo -n "Critical"
exitcode=2
fi
fi
-echo -n ": $total errors in total in $LOG."
+echo -n "$exitcode $CHECKNAME errors=$total ${STATUS[exitcode]}: $total errors in total in $LOG."
if [ ! $total -eq 0 ]
then