Skip to content

Commit

Permalink
fix: ipset crash when command not found (influxdata#10474)
Browse files Browse the repository at this point in the history
  • Loading branch information
powersj authored Jan 24, 2022
1 parent c9c0516 commit d2fa0fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/inputs/ipset/ipset.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ func (i *Ipset) SampleConfig() string {
`
}

func (i *Ipset) Init() error {
_, err := exec.LookPath("ipset")
if err != nil {
return err
}

return nil
}

func (i *Ipset) Gather(acc telegraf.Accumulator) error {
out, e := i.lister(i.Timeout, i.UseSudo)
if e != nil {
Expand Down

0 comments on commit d2fa0fa

Please sign in to comment.