fix(agent): Only set default snmp after reading all configs (#12457)
This commit is contained in:
parent
82bf8497f1
commit
2604fb684b
|
|
@ -426,6 +426,11 @@ func (c *Config) LoadAll(configFiles ...string) error {
|
|||
sort.Stable(c.Processors)
|
||||
sort.Stable(c.AggProcessors)
|
||||
|
||||
// Set snmp agent translator default
|
||||
if c.Agent.SnmpTranslator == "" {
|
||||
c.Agent.SnmpTranslator = "netsnmp"
|
||||
}
|
||||
|
||||
// Let's link all secrets to their secret-stores
|
||||
return c.LinkSecrets()
|
||||
}
|
||||
|
|
@ -482,10 +487,6 @@ func (c *Config) LoadConfigData(data []byte) error {
|
|||
Notice: "Use 'gosmi' instead",
|
||||
})
|
||||
}
|
||||
// Set snmp agent translator default
|
||||
if c.Agent.SnmpTranslator == "" {
|
||||
c.Agent.SnmpTranslator = "netsnmp"
|
||||
}
|
||||
|
||||
if len(c.UnusedFields) > 0 {
|
||||
return fmt.Errorf("line %d: configuration specified the fields %q, but they weren't used", tbl.Line, keys(c.UnusedFields))
|
||||
|
|
|
|||
Loading…
Reference in New Issue