File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# shellcheck disable=SC2181,SC2207,SC2199,SC2076
3
- #
4
3
5
4
# #########################
6
5
# Perform checks against Kubernetes API or with tab help of kubectl utility
@@ -31,6 +30,7 @@ usage() {
31
30
- Pvc storage utilization; default is 80%
32
31
- API cert expiration days for apicert mode; default is 30
33
32
-c CRIT Critical threshold for
33
+ - TLS expiration days for TLS mode; default is 5
34
34
- Pod restart count (in pods mode); default is 150
35
35
- Unbound Persistent Volumes in unboundpvs mode; default is 5
36
36
- Job failed count in jobs mode; default is 2
@@ -298,6 +298,7 @@ mode_pvc() {
298
298
299
299
mode_tls () {
300
300
WARN=${WARN:- 30}
301
+ CRIT=${CRIT:- 5}
301
302
302
303
count_ok=0
303
304
count_warn=0
@@ -338,6 +339,10 @@ mode_tls() {
338
339
(( count_crit++ ))
339
340
EXITCODE=2
340
341
OUTPUT=" $OUTPUT $ns /$cert is expired."
342
+ elif [ " $diff " -le " $(( CRIT* 24 * 3600 )) " ]; then
343
+ (( count_crit++ ))
344
+ EXITCODE=2
345
+ OUTPUT=" $OUTPUT $ns /$cert is about to expire in $(( diff/ 3600 / 24 )) days."
341
346
elif [ " $diff " -le " $(( WARN* 24 * 3600 )) " ]; then
342
347
(( count_warn++ ))
343
348
if [ " $EXITCODE " == 0 ]; then
You can’t perform that action at this time.
0 commit comments