From ba03ea9928db40305eda055d93fde21d7f4f79b3 Mon Sep 17 00:00:00 2001 From: honza Date: Fri, 23 Aug 2019 14:07:55 +0200 Subject: [PATCH] update check_es_docs.sh Signed-off-by: honza --- check_es-docs.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/check_es-docs.sh b/check_es-docs.sh index 4f29b7b..af8dd9c 100644 --- a/check_es-docs.sh +++ b/check_es-docs.sh @@ -37,7 +37,7 @@ do u) user=$OPTARG;; p) password=$OPTARG;; h) es_host=$OPTARG;; - h) indexes=$OPTARG;; + i) indexes=$OPTARG;; w) docs_warning=$OPTARG;; c) docs_critical=$OPTARG;; s) seconds=$OPTARG;; @@ -60,15 +60,15 @@ result=$(curl -k -s -u ${user}:${password} -X GET "${es_host}/${indexes}/_count if [[ -z $result ]]; then status=3 - message="Unknown: unable to get the number of documents from within the last ${seconds} seconds." + message="Unknown: unable to get the number of documents in ${indexes} from within the last ${seconds} seconds." elif [[ $result -le $docs_critical ]]; then status=2 - message="Critical: ${result} documents were found from within the last ${seconds} seconds." + message="Critical: ${result} documents were found in ${indexes} from within the last ${seconds} seconds." elif [[ $result -le $docs_warning ]]; then status=1 - message="Warning: ${result} documents were found from within the last ${seconds} seconds." + message="Warning: ${result} documents were found in ${indexes} from within the last ${seconds} seconds." else - message="OK: ${result} documents were found from within the last ${seconds} seconds." + message="OK: ${result} documents were found in ${indexes} from within the last ${seconds} seconds." status=0 fi