Skip to content

Commit

Permalink
update check_es_docs.sh
Browse files Browse the repository at this point in the history
Signed-off-by: honza <[email protected]>
  • Loading branch information
honza committed Aug 23, 2019
1 parent 11c11f3 commit ba03ea9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions check_es-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
Expand All @@ -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

Expand Down

0 comments on commit ba03ea9

Please sign in to comment.