Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f9e858

Browse files
authored
fix(go.d/ping): preserve original ping error by using %w for wrapping (#21251)
1 parent 2efceb8 commit 3f9e858

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/go/plugin/go.d/collector/ping/prober.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (p *pingProber) Ping(host string) (*probing.Statistics, error) {
5757
pr.SetLogger(nil)
5858

5959
if err := pr.Run(); err != nil {
60-
return nil, fmt.Errorf("pinging host '%s' (ip '%s' iface '%s'): %v",
60+
return nil, fmt.Errorf("pinging host '%s' (ip '%s' iface '%s'): %w",
6161
pr.Addr(), pr.IPAddr(), pr.InterfaceName, err)
6262
}
6363

src/go/plugin/go.d/collector/snmp/collector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func New() *Collector {
5959
Privileged: true,
6060
Packets: 3,
6161
Interval: confopt.Duration(time.Millisecond * 100),
62+
Network: "ip",
6263
},
6364
},
6465
},

0 commit comments

Comments
 (0)