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

nstat plugin does not run properly without explicit paths #1477

Closed
rjjanuary opened this issue Jul 10, 2016 · 0 comments · Fixed by #1520
Closed

nstat plugin does not run properly without explicit paths #1477

rjjanuary opened this issue Jul 10, 2016 · 0 comments · Fixed by #1520

Comments

@rjjanuary
Copy link

rjjanuary commented Jul 10, 2016

Bug report

Relevant telegraf.conf:

Working config:
[[inputs.nstat]]
proc_net_netstat = "/proc/net/netstat"
proc_net_snmp = "/proc/net/snmp"
proc_net_snmp6 = "/proc/net/snmp6"
dump_zeros = true

Configs resulting in runtime errors below:
[[inputs.nstat]]
dump_zeros = true

[[inputs.nstat]]
proc_net_netstat = ""
proc_net_snmp = ""
proc_net_snmp6 = ""
dump_zeros = true

System info:

-bash-4.2$ telegraf -version
Telegraf - version 0.13.1
-bash-4.2$ cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
-bash-4.2$ uname -a
Linux ets-vvaprd-metrics-a01.cdc.nicusa.com 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce:

  1. include sample nstat influx config into telegraf.conf
  2. restart

Expected behavior:

nstat plugin collects info as documented

Actual behavior:

telegraf process produces runtime errors

Additional info:

Error from telegraf.log when not supplying explicit paths in telegraf config

panic: runtime error: index out of range

goroutine 15 [running]:
panic(0x107ebc0, 0xc820010060)
        /usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/telegraf/plugins/inputs/nstat.loadUglyTable(0xc8205ad000, 0xbd4, 0xe00, 0x1, 0x0, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/nstat/nstat.go:197 +0x83c
github.com/influxdata/telegraf/plugins/inputs/nstat.(*Nstat).gatherSNMP(0xc82015ab80, 0xc8205ad000, 0xbd4, 0xe00, 0x7f06aaf8f9a0, 0xc820209fb0, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/nstat/nstat.go:111 +0x5f
github.com/influxdata/telegraf/plugins/inputs/nstat.(*Nstat).Gather(0xc82015ab80, 0x7f06aaf8f9a0, 0xc820209fb0, 0x0, 0x0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/nstat/nstat.go:81 +0x1d9
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc820058c00, 0xc82000f440, 0xc820209fb0)
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:174 +0x73
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/agent/agent.go:175 +0xe0
sparrc added a commit that referenced this issue Jul 19, 2016
sparrc added a commit that referenced this issue Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant