File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 12
12
usage () {
13
13
cat << - EOF
14
14
Usage $0 [-m <MODE>|-h] [-o <TIMEOUT>] [-H <APISERVER> [-T <TOKEN>|-t <TOKENFILE>]] [-K <KUBE_CONFIG>]
15
- [-N <NAMESPACE>] [-n <NAME>] [-w <WARN>] [-c <CRIT>]
15
+ [-N <NAMESPACE>] [-n <NAME>] [-w <WARN>] [-c <CRIT>] [-v]
16
16
17
17
Options are:
18
18
-m MODE Which check to perform
@@ -36,6 +36,7 @@ usage() {
36
36
- Pvc storage utilization; default is 90%
37
37
- API cert expiration days for apicert mode; default is 15
38
38
-M EXIT_CODE Exit code when resource is missing; default is 2 (CRITICAL)
39
+ -v Show current Version
39
40
-h Show this help and exit
40
41
41
42
Modes are:
@@ -56,6 +57,8 @@ usage() {
56
57
exit 2
57
58
}
58
59
60
+ VERSION=" v1.3.1"
61
+
59
62
TIMEOUT=15
60
63
unset NAME
61
64
@@ -64,7 +67,7 @@ die() {
64
67
exit " ${2:- 2} "
65
68
}
66
69
67
- while getopts " :m:M:H:T:t:K:N:n:o:c:w:h" arg; do
70
+ while getopts " :m:M:H:T:t:K:N:n:o:c:w:h:v " arg; do
68
71
case $arg in
69
72
h) usage ;;
70
73
m) MODE=" $OPTARG " ;;
@@ -78,6 +81,7 @@ while getopts ":m:M:H:T:t:K:N:n:o:c:w:h" arg; do
78
81
n) NAME=" $OPTARG " ;;
79
82
w) WARN=" $OPTARG " ;;
80
83
c) CRIT=" $OPTARG " ;;
84
+ v) echo " check_kubernetes.sh Version: $VERSION " && exit 0 ;;
81
85
* ) usage ;;
82
86
esac
83
87
done
You can’t perform that action at this time.
0 commit comments