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

feat: Ability to override commands args
This commit is contained in:
Jason Kulatunga
2025-01-08 10:46:10 -07:00
committed by GitHub
+5
View File
@@ -49,6 +49,11 @@ func (c *configuration) Init() error {
c.SetDefault("commands.metrics_smart_args", "--xall --json")
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("allow_listed_devices", []string{})