File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,10 @@ func (c *configuration) Init() error {
4848 c .SetDefault ("commands.metrics_info_args" , "--info --json" )
4949 c .SetDefault ("commands.metrics_smart_args" , "--xall --json" )
5050
51- // Bind environment variables with COLLECTOR_ prefix
52- c .BindEnv ("host.id" , "COLLECTOR_HOST_ID" )
53- c .BindEnv ("log.level" , "COLLECTOR_LOG_LEVEL" )
54- c .BindEnv ("log.file" , "COLLECTOR_LOG_FILE" )
55- c .BindEnv ("api.endpoint" , "COLLECTOR_API_ENDPOINT" )
56- c .BindEnv ("commands.metrics_smartctl_bin" , "COLLECTOR_COMMANDS_METRICS_SMARTCTL_BIN" )
57- c .BindEnv ("commands.metrics_scan_args" , "COLLECTOR_COMMANDS_METRICS_SCAN_ARGS" )
58- c .BindEnv ("commands.metrics_info_args" , "COLLECTOR_COMMANDS_METRICS_INFO_ARGS" )
59- c .BindEnv ("commands.metrics_smart_args" , "COLLECTOR_COMMANDS_METRICS_SMART_ARGS" )
51+ //configure env variable parsing.
52+ c .SetEnvPrefix ("COLLECTOR" )
53+ c .SetEnvKeyReplacer (strings .NewReplacer ("-" , "_" , "." , "_" ))
54+ c .AutomaticEnv ()
6055
6156 //c.SetDefault("collect.short.command", "-a -o on -S on")
6257
You can’t perform that action at this time.
0 commit comments