@@ -42,22 +42,30 @@ func init() {
42
42
43
43
pfs := rootCmd .PersistentFlags ()
44
44
pfs .StringVarP (& cliConfig .Hostname , "hostname" , "H" , "localhost" ,
45
- "Hostname of the Elasticsearch instance" )
45
+ "Hostname of the Elasticsearch instance (CHECK_ELASTICSEARCH_HOSTNAME) " )
46
46
pfs .IntVarP (& cliConfig .Port , "port" , "p" , 9200 ,
47
47
"Port of the Elasticsearch instance" )
48
48
pfs .StringVarP (& cliConfig .Username , "username" , "U" , "" ,
49
- "Username for HTTP Basic Authentication" )
49
+ "Username for HTTP Basic Authentication (CHECK_ELASTICSEARCH_USERNAME) " )
50
50
pfs .StringVarP (& cliConfig .Password , "password" , "P" , "" ,
51
- "Password for HTTP Basic Authentication" )
51
+ "Password for HTTP Basic Authentication (CHECK_ELASTICSEARCH_PASSWORD) " )
52
52
pfs .BoolVarP (& cliConfig .TLS , "tls" , "S" , false ,
53
53
"Use a HTTPS connection" )
54
54
pfs .BoolVar (& cliConfig .Insecure , "insecure" , false ,
55
55
"Skip the verification of the server's TLS certificate" )
56
+ pfs .StringVarP (& cliConfig .CAFile , "ca-file" , "" , "" ,
57
+ "Specify the CA File for TLS authentication (CHECK_ELASTICSEARCH_CA_FILE)" )
58
+ pfs .StringVarP (& cliConfig .CertFile , "cert-file" , "" , "" ,
59
+ "Specify the Certificate File for TLS authentication (CHECK_ELASTICSEARCH_CERT_FILE)" )
60
+ pfs .StringVarP (& cliConfig .KeyFile , "key-file" , "" , "" ,
61
+ "Specify the Key File for TLS authentication (CHECK_ELASTICSEARCH_KEY_FILE)" )
56
62
pfs .IntVarP (& timeout , "timeout" , "t" , timeout ,
57
63
"Timeout in seconds for the CheckPlugin" )
58
64
59
65
rootCmd .Flags ().SortFlags = false
60
66
pfs .SortFlags = false
67
+
68
+ loadFromEnv (& cliConfig )
61
69
}
62
70
63
71
func Help (cmd * cobra.Command , _ []string ) {
0 commit comments