@@ -42,22 +42,30 @@ func init() {
4242
4343 pfs := rootCmd .PersistentFlags ()
4444 pfs .StringVarP (& cliConfig .Hostname , "hostname" , "H" , "localhost" ,
45- "Hostname of the Elasticsearch instance" )
45+ "Hostname of the Elasticsearch instance (CHECK_ELASTICSEARCH_HOSTNAME) " )
4646 pfs .IntVarP (& cliConfig .Port , "port" , "p" , 9200 ,
4747 "Port of the Elasticsearch instance" )
4848 pfs .StringVarP (& cliConfig .Username , "username" , "U" , "" ,
49- "Username for HTTP Basic Authentication" )
49+ "Username for HTTP Basic Authentication (CHECK_ELASTICSEARCH_USERNAME) " )
5050 pfs .StringVarP (& cliConfig .Password , "password" , "P" , "" ,
51- "Password for HTTP Basic Authentication" )
51+ "Password for HTTP Basic Authentication (CHECK_ELASTICSEARCH_PASSWORD) " )
5252 pfs .BoolVarP (& cliConfig .TLS , "tls" , "S" , false ,
5353 "Use a HTTPS connection" )
5454 pfs .BoolVar (& cliConfig .Insecure , "insecure" , false ,
5555 "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)" )
5662 pfs .IntVarP (& timeout , "timeout" , "t" , timeout ,
5763 "Timeout in seconds for the CheckPlugin" )
5864
5965 rootCmd .Flags ().SortFlags = false
6066 pfs .SortFlags = false
67+
68+ loadFromEnv (& cliConfig )
6169}
6270
6371func Help (cmd * cobra.Command , _ []string ) {
0 commit comments