diff options
author | varac <varacanero@zeromail.org> | 2014-02-14 16:25:54 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2014-02-14 16:25:54 +0100 |
commit | 126811e6c8f9fdf8bc5ff2c2c0277f1fa7dae83c (patch) | |
tree | 9b1fe40978435f681f45d09b9ede185eed59e8e6 /tests | |
parent | 26feb4a5b58badf97abd5fffffc8ebf6a0b341f3 (diff) |
modified check_bigcouch_errors.sh output to be check_mk compatible
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/check_bigcouch_errors.sh | 10 |
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 |