Make tests in the correct order
This commit is contained in:
parent
332c62e5ca
commit
f0e60e3a30
10
check_bgp
10
check_bgp
|
@ -113,10 +113,7 @@ ROUTE_HIT_OUT="$($birdc show protocol all ${SESSION} | \
|
||||||
|
|
||||||
case ${STATE} in
|
case ${STATE} in
|
||||||
Established)
|
Established)
|
||||||
if [ ${RATIO_IN} -lt 90 ]; then
|
if [ "${ROUTE_HIT_IN}" != "" ]; then
|
||||||
printf "OK: ${SESSION} is ${STATE}\n"
|
|
||||||
exit 0
|
|
||||||
elif [ "${ROUTE_HIT_IN}" != "" ]; then
|
|
||||||
printf "CRITICAL: ${SESSION} has hit import route "
|
printf "CRITICAL: ${SESSION} has hit import route "
|
||||||
printf "limit\n"
|
printf "limit\n"
|
||||||
exit 2
|
exit 2
|
||||||
|
@ -124,10 +121,13 @@ case ${STATE} in
|
||||||
printf "CRITICAL: ${SESSION} has hit export route "
|
printf "CRITICAL: ${SESSION} has hit export route "
|
||||||
printf "limit\n"
|
printf "limit\n"
|
||||||
exit 2
|
exit 2
|
||||||
else
|
elif [ ${RATIO_IN} -gt 90 ]; then
|
||||||
printf "WARNING: ${SESSION} import route limit is "
|
printf "WARNING: ${SESSION} import route limit is "
|
||||||
printf "over thresold\n"
|
printf "over thresold\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
printf "OK: ${SESSION} is ${STATE}\n"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
OpenSent | OpenConfirm)
|
OpenSent | OpenConfirm)
|
||||||
|
|
Loading…
Reference in a new issue