@@ -40,23 +40,23 @@ func init() {
4040
4141 pfs := rootCmd .PersistentFlags ()
4242 pfs .StringVarP (& cliConfig .Hostname , "hostname" , "H" , "localhost" ,
43- "Hostname of the Logstash server" )
43+ "Hostname of the Logstash server (CHECK_LOGSTASH_HOSTNAME) " )
4444 pfs .IntVarP (& cliConfig .Port , "port" , "p" , 9600 ,
4545 "Port of the Logstash server" )
4646 pfs .BoolVarP (& cliConfig .Secure , "secure" , "s" , false ,
4747 "Use a HTTPS connection" )
4848 pfs .BoolVarP (& cliConfig .Insecure , "insecure" , "i" , false ,
4949 "Skip the verification of the server's TLS certificate" )
5050 pfs .StringVarP (& cliConfig .Bearer , "bearer" , "b" , "" ,
51- "Specify the Bearer Token for server authentication" )
51+ "Specify the Bearer Token for server authentication (CHECK_LOGSTASH_BEARER) " )
5252 pfs .StringVarP (& cliConfig .BasicAuth , "user" , "u" , "" ,
53- "Specify the user name and password for server authentication <user:password>" )
53+ "Specify the user name and password for server authentication <user:password> (CHECK_LOGSTASH_BASICAUTH) " )
5454 pfs .StringVarP (& cliConfig .CAFile , "ca-file" , "" , "" ,
55- "Specify the CA File for TLS authentication" )
55+ "Specify the CA File for TLS authentication (CHECK_LOGSTASH_CA_FILE) " )
5656 pfs .StringVarP (& cliConfig .CertFile , "cert-file" , "" , "" ,
57- "Specify the Certificate File for TLS authentication" )
57+ "Specify the Certificate File for TLS authentication (CHECK_LOGSTASH_CERT_FILE) " )
5858 pfs .StringVarP (& cliConfig .KeyFile , "key-file" , "" , "" ,
59- "Specify the Key File for TLS authentication" )
59+ "Specify the Key File for TLS authentication (CHECK_LOGSTASH_KEY_FILE) " )
6060 pfs .IntVarP (& Timeout , "timeout" , "t" , Timeout ,
6161 "Timeout in seconds for the CheckPlugin" )
6262
@@ -65,6 +65,8 @@ func init() {
6565
6666 help := rootCmd .HelpTemplate ()
6767 rootCmd .SetHelpTemplate (help + Copyright )
68+
69+ check .LoadFromEnv (& cliConfig )
6870}
6971
7072func Usage (cmd * cobra.Command , _ []string ) {
0 commit comments