Skip to content

Commit

Permalink
feat: diable snmp_up option
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Apr 29, 2024
1 parent 18ebd39 commit 8f49f3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inputs/snmp/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type Instance struct {
Name string `toml:"name"`
Fields []Field `toml:"field"`

DisableUp bool `toml:"disable_up"`

connectionCache []snmpConnection

Translator string `toml:"translator"`
Expand Down Expand Up @@ -154,7 +156,9 @@ func (ins *Instance) Gather(slist *types.SampleList) {
if m, ok := ins.Mappings[agent]; ok {
extraTags = m
}
ins.up(slist, i)
if !ins.DisableUp {
ins.up(slist, i)
}

gs, err := ins.getConnection(i)
if err != nil {
Expand Down

0 comments on commit 8f49f3f

Please sign in to comment.