This commit is contained in:
parent
ce507e522f
commit
ee5827ccbd
|
@ -36,6 +36,8 @@ The sample config file
|
||||||
# dump_zeros = true
|
# dump_zeros = true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
In case that `proc_net_snmp6` path doesn't exist (e.g. IPv6 is not enabled) no error would be raised.
|
||||||
|
|
||||||
### Measurements & Fields
|
### Measurements & Fields
|
||||||
|
|
||||||
- nstat
|
- nstat
|
||||||
|
|
|
@ -83,13 +83,14 @@ func (ns *Nstat) Gather(acc telegraf.Accumulator) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect SNMP6 data
|
// collect SNMP6 data, if SNMP6 directory exists (IPv6 enabled)
|
||||||
snmp6, err := ioutil.ReadFile(ns.ProcNetSNMP6)
|
snmp6, err := ioutil.ReadFile(ns.ProcNetSNMP6)
|
||||||
|
if err == nil {
|
||||||
|
err = ns.gatherSNMP6(snmp6, acc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = ns.gatherSNMP6(snmp6, acc)
|
} else if !os.IsNotExist(err) {
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue