diff --git a/check_rancher2.sh b/check_rancher2.sh index 10e85bc..7ca42ea 100755 --- a/check_rancher2.sh +++ b/check_rancher2.sh @@ -33,6 +33,7 @@ # 20190308 1.1.0 Added node(s) check # # 20190903 1.1.1 Detect invalid hostname (non-API hostname) # # 20190903 1.2.0 Allow self-signed certificates (-s) # +# 20190913 1.2.1 Detect additional redirect (308) # ########################################################################################## # (Pre-)Define some fixed variables STATE_OK=0 # define the exit code if status is OK @@ -41,7 +42,7 @@ STATE_CRITICAL=2 # define the exit code if status is Critical STATE_UNKNOWN=3 # define the exit code if status is Unknown export PATH=/usr/local/bin:/usr/bin:/bin:$PATH # Set path proto=http # Protocol to use, default is http, can be overwritten with -S parameter -version=1.2.0 +version=1.2.1 # Check for necessary commands for cmd in jshon curl [ @@ -118,6 +119,8 @@ elif [[ $apicheck = 301 ]] then echo -e "CHECK_RANCHER2 UNKNOWN - Redirect detected. Maybe http to https? Use -S parameter."; exit ${STATE_UNKNOWN} elif [[ $apicheck = 302 ]] then echo -e "CHECK_RANCHER2 UNKNOWN - Redirect detected. Maybe http to https? Use -S parameter."; exit ${STATE_UNKNOWN} +elif [[ $apicheck = 308 ]] +then echo -e "CHECK_RANCHER2 UNKNOWN - Redirect detected. Maybe http to https? Use -S parameter."; exit ${STATE_UNKNOWN} elif [[ $apicheck = 401 ]] then echo -e "CHECK_RANCHER2 WARNING - Authentication failed"; exit ${STATE_WARNING} elif [[ $apicheck -gt 499 ]]