File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ usage() {
30
30
- Pvc storage utilization; default is 80%
31
31
- API cert expiration days for apicert mode; default is 30
32
32
-c CRIT Critical threshold for
33
+ - TLS expiration days for TLS mode; default is 0
33
34
- Pod restart count (in pods mode); default is 150
34
35
- Unbound Persistent Volumes in unboundpvs mode; default is 5
35
36
- Job failed count in jobs mode; default is 2
@@ -297,6 +298,7 @@ mode_pvc() {
297
298
298
299
mode_tls () {
299
300
WARN=${WARN:- 30}
301
+ CRIT=${CRIT:- 0}
300
302
301
303
count_ok=0
302
304
count_warn=0
@@ -337,6 +339,10 @@ mode_tls() {
337
339
(( count_crit++ ))
338
340
EXITCODE=2
339
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."
340
346
elif [ " $diff " -le " $(( WARN* 24 * 3600 )) " ]; then
341
347
(( count_warn++ ))
342
348
if [ " $EXITCODE " == 0 ]; then
You can’t perform that action at this time.
0 commit comments