From 126811e6c8f9fdf8bc5ff2c2c0277f1fa7dae83c Mon Sep 17 00:00:00 2001 From: varac Date: Fri, 14 Feb 2014 16:25:54 +0100 Subject: modified check_bigcouch_errors.sh output to be check_mk compatible --- tests/check_bigcouch_errors.sh | 10 ++++++---- 1 file 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 -- cgit v1.2.3