File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 37
37
# 20190903 1.2.0 Allow self-signed certificates (-s) #
38
38
# 20190913 1.2.1 Detect additional redirect (308) #
39
39
# 20200129 1.2.2 Fix typos in workload perfdata (#11) and single cluster health (#12) #
40
+ # 20200523 1.2.3 Handle 403 forbidden error (#15) #
40
41
# #########################################################################################
41
42
# (Pre-)Define some fixed variables
42
43
STATE_OK=0 # define the exit code if status is OK
@@ -45,7 +46,7 @@ STATE_CRITICAL=2 # define the exit code if status is Critical
45
46
STATE_UNKNOWN=3 # define the exit code if status is Unknown
46
47
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH # Set path
47
48
proto=http # Protocol to use, default is http, can be overwritten with -S parameter
48
- version=1.2.2
49
+ version=1.2.3
49
50
50
51
# Check for necessary commands
51
52
for cmd in jshon curl [
@@ -126,6 +127,8 @@ elif [[ $apicheck = 308 ]]
126
127
then echo -e " CHECK_RANCHER2 UNKNOWN - Redirect detected. Maybe http to https? Use -S parameter." ; exit ${STATE_UNKNOWN}
127
128
elif [[ $apicheck = 401 ]]
128
129
then echo -e " CHECK_RANCHER2 WARNING - Authentication failed" ; exit ${STATE_WARNING}
130
+ elif [[ $apicheck = 403 ]]
131
+ then echo -e " CHECK_RANCHER2 WARNING - Access to API forbidden" ; exit ${STATE_CRITICAL}
129
132
elif [[ $apicheck -gt 499 ]]
130
133
then echo -e " CHECK_RANCHER2 CRITICAL - API Returned HTTP $apicheck error" ; exit ${STATE_CRITICAL}
131
134
fi
You can’t perform that action at this time.
0 commit comments