Skip to content

Commit

Permalink
1.6.1, fix missing word 'than' (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Napsty authored Sep 24, 2019
1 parent b0accd6 commit ee753c1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions check_es_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@
# 20190905: Catch empty cluster health status (issue #13) #
# 20190909: Added jthreads and tps (thread pool stats) check types #
# 20190909: Handle correct curl return codes #
# 20190924: Missing 'than' in tps output #
################################################################################
#Variables and defaults
STATE_OK=0 # define the exit code if status is OK
STATE_WARNING=1 # define the exit code if status is Warning
STATE_CRITICAL=2 # define the exit code if status is Critical
STATE_UNKNOWN=3 # define the exit code if status is Unknown
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin # Set path
version=1.6
version=1.6.1
port=9200
httpscheme=http
unit=G
Expand Down Expand Up @@ -445,7 +446,7 @@ tps) # Check Thread Pool Statistics
echo "Thread Pool ${tpname[$i]} is critical: Active ($tpa) is equal or higher than threshold ($cactive)|${perfdata[*]}"
exit $STATE_CRITICAL
elif [[ $tpa -ge $wactive ]]; then
echo "Thread Pool ${tpname[$i]} is warning: Active ($tpa) is equal or higher threshold ($wactive)|${perfdata[*]}"
echo "Thread Pool ${tpname[$i]} is warning: Active ($tpa) is equal or higher than threshold ($wactive)|${perfdata[*]}"
exit $STATE_WARNING
fi
let i++
Expand All @@ -454,10 +455,10 @@ tps) # Check Thread Pool Statistics
i=0
for tpq in $(echo ${tpqueue[*]}); do
if [[ $tpq -ge $cqueue ]]; then
echo "Thread Pool ${tpname[$i]} is critical: Queue ($tpq) is equal or higher threshold ($cqueue)|${perfdata[*]}"
echo "Thread Pool ${tpname[$i]} is critical: Queue ($tpq) is equal or higher than threshold ($cqueue)|${perfdata[*]}"
exit $STATE_CRITICAL
elif [[ $tpq -ge $wqueue ]]; then
echo "Thread Pool ${tpname[$i]} is warning: Queue ($tpq) is equal or higher threshold ($wqueue)|${perfdata[*]}"
echo "Thread Pool ${tpname[$i]} is warning: Queue ($tpq) is equal or higher than threshold ($wqueue)|${perfdata[*]}"
exit $STATE_WARNING
fi
let i++
Expand All @@ -466,10 +467,10 @@ tps) # Check Thread Pool Statistics
i=0
for tpr in $(echo ${tprejected[*]}); do
if [[ $tpr -ge $crejected ]]; then
echo "Thread Pool ${tpname[$i]} is critical: Rejected ($tpr) is equal or higher threshold ($crejected)|${perfdata[*]}"
echo "Thread Pool ${tpname[$i]} is critical: Rejected ($tpr) is equal or higher than threshold ($crejected)|${perfdata[*]}"
exit $STATE_CRITICAL
elif [[ $tpr -ge $wrejected ]]; then
echo "Thread Pool ${tpname[$i]} is warning: Rejected ($tpr) is equal or higher threshold ($wrejected)|${perfdata[*]}"
echo "Thread Pool ${tpname[$i]} is warning: Rejected ($tpr) is equal or higher than threshold ($wrejected)|${perfdata[*]}"
exit $STATE_WARNING
fi
let i++
Expand Down

0 comments on commit ee753c1

Please sign in to comment.