Merge pull request #619 from datenzar/override-config-with-env-variables

feat: Ability to override commands args
master
Jason Kulatunga 2 days ago committed by GitHub
commit a58f9445c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -49,6 +49,11 @@ func (c *configuration) Init() error {
c.SetDefault("commands.metrics_smart_args", "--xall --json") c.SetDefault("commands.metrics_smart_args", "--xall --json")
c.SetDefault("commands.metrics_smartctl_wait", 0) c.SetDefault("commands.metrics_smartctl_wait", 0)
//configure env variable parsing.
c.SetEnvPrefix("COLLECTOR")
c.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))
c.AutomaticEnv()
//c.SetDefault("collect.short.command", "-a -o on -S on") //c.SetDefault("collect.short.command", "-a -o on -S on")
c.SetDefault("allow_listed_devices", []string{}) c.SetDefault("allow_listed_devices", []string{})

Loading…
Cancel
Save