From 4cdcbf3a49f97b0c5e45a98265397d97115937f5 Mon Sep 17 00:00:00 2001 From: Dane Strandboge <136023093+DStrand1@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:53:16 -0600 Subject: [PATCH] address reviews --- plugins/inputs/snmp_trap/README.md | 2 +- plugins/inputs/snmp_trap/sample.conf | 2 +- plugins/inputs/snmp_trap/snmp_trap.go | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/inputs/snmp_trap/README.md b/plugins/inputs/snmp_trap/README.md index dbb10c8322fe3..f9d19576ac62c 100644 --- a/plugins/inputs/snmp_trap/README.md +++ b/plugins/inputs/snmp_trap/README.md @@ -63,7 +63,7 @@ details. # path = ["/usr/share/snmp/mibs"] ## ## Timeout running snmptranslate command - ## Used by the netsnmp translator + ## Used by the netsnmp translator only # timeout = "5s" ## Snmp version; one of "1", "2c" or "3". # version = "2c" diff --git a/plugins/inputs/snmp_trap/sample.conf b/plugins/inputs/snmp_trap/sample.conf index 0f84e6c95abc5..3ab073c8876f6 100644 --- a/plugins/inputs/snmp_trap/sample.conf +++ b/plugins/inputs/snmp_trap/sample.conf @@ -15,7 +15,7 @@ # path = ["/usr/share/snmp/mibs"] ## ## Timeout running snmptranslate command - ## Used by the netsnmp translator + ## Used by the netsnmp translator only # timeout = "5s" ## Snmp version; one of "1", "2c" or "3". # version = "2c" diff --git a/plugins/inputs/snmp_trap/snmp_trap.go b/plugins/inputs/snmp_trap/snmp_trap.go index 05ba470db3c24..6bebba984ec5b 100644 --- a/plugins/inputs/snmp_trap/snmp_trap.go +++ b/plugins/inputs/snmp_trap/snmp_trap.go @@ -84,6 +84,7 @@ func init() { return &SnmpTrap{ timeFunc: time.Now, ServiceAddress: "udp://:162", + Timeout: defaultTimeout, Path: []string{"/usr/share/snmp/mibs"}, Version: "2c", } @@ -103,9 +104,6 @@ func (s *SnmpTrap) Init() error { return err } case "netsnmp": - if s.Timeout == 0 { - s.Timeout = defaultTimeout - } s.transl = newNetsnmpTranslator(s.Timeout) default: return errors.New("invalid translator value")