Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[inputs/nstat] error on snmp6 when ipv6 is disabled #5403

Closed
deric opened this issue Feb 11, 2019 · 4 comments
Closed

[inputs/nstat] error on snmp6 when ipv6 is disabled #5403

deric opened this issue Feb 11, 2019 · 4 comments
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@deric
Copy link
Contributor

deric commented Feb 11, 2019

Relevant telegraf.conf:

[[inputs.nstat]]

System info:

Debian 4.9.110-3+deb9u4 (2018-08-21), Telegraf 1.9.4

Steps to reproduce:

  1. Linux kernel without IPv6 support ipv6.disable=1

Expected behavior:

Silently ignore missing /proc/net/snmp6.

Workaround

redirect snmp6 to snmp and then ignore it.

[[inputs.nstat]]
proc_net_snmp6 = "/proc/net/snmp"
namedrop = "snmp6"

Not a good idea. Incorrectly parsed snmp6 fields with enormous cardinality:

> SHOW FIELD KEY CARDINALITY FROM nstat
name: nstat
count
-----
389040

Actual behavior:

E! [inputs.nstat]: Error in plugin: open /proc/net/snmp6: no such file or directory
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Feb 11, 2019
@danielnelson danielnelson added this to the 1.10.0 milestone Feb 11, 2019
@danielnelson
Copy link
Contributor

As a workaround you can add this option:

[[inputs.nstat]]
  proc_net_snmp6 = "/dev/null"

@deric
Copy link
Contributor Author

deric commented Feb 14, 2019

@danielnelson Right, that's much better solution.

Just curious, nstat offers JSON output, why not use that?

nstat -a --json

It gives pretty much the same output, except all metrics are merged into single category (no snmp, snmp6 or nestat namespace) and you don't have to parse 3 files from disk.

Is a PR witch such change acceptable for telegraf? Or would you prefer keeping names of metrics the same way?

@danielnelson
Copy link
Contributor

It is faster to read 3 files than to exec a binary, and then of course using it would add a dependency on the nstat binary. If you strace nstat you can see it opens these 3 files as well.

On naming, we try to keep everything backwards compatible so as to not break any dashboard or alerts.

@deric
Copy link
Contributor Author

deric commented Feb 14, 2019

Sure, makes sense. Thanks for explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants