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

snmp plugin not producing any data #2628

Closed
ayounas opened this issue Apr 4, 2017 · 5 comments
Closed

snmp plugin not producing any data #2628

ayounas opened this issue Apr 4, 2017 · 5 comments
Labels
bug unexpected problem or unintended behavior

Comments

@ayounas
Copy link

ayounas commented Apr 4, 2017

Bug report

I am using snmp input to query different checkpoint firewall oids and writing them to a tcp socket which is a splunk instance. snmpget returns data but telegraf doesn't return any thing. e.g

[abc@xxxxxx telegraf.d]# snmpget -c public -v2c 10.xxx.xxx.xxx .1.3.6.1.4.1.2620.1.1.25.4.0
SNMPv2-SMI::enterprises.2620.1.1.25.4.0 = INTEGER: 1250140
[abc@xxxxxx telegraf.d]# snmpget -c public -v2c 10.xxx.xxx.xxx .1.3.6.1.4.1.2620.1.1.25.3.0
SNMPv2-SMI::enterprises.2620.1.1.25.3.0 = INTEGER: 129196

I have tried converting to float, int and without conversion but still nothing.

Relevant telegraf.conf:

[global_tags]
dc = "DC1" # will tag all metrics with dc=us-east-1

[agent]
interval = "60s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "60s"
flush_jitter = "0s"
precision = ""
debug = true
quiet = false
logfile = "/var/log/telegraf/telegraf.log"
hostname = "myhost"
omit_hostname = true

[[outputs.socket_writer]]
address = "tcp://10.xxx.xxx.xxx:2005"
data_format = "json"

[[inputs.snmp]]
agents = [ "10.xx.xx.xx:161" ]
version = 2
timeout = "5s"
retries = 3
community = "public"

[[inputs.snmp.field]]
name = "maxconns"
oid = ".1.3.6.1.4.1.2620.1.1.25.4.0"
conversion = "int"

[[inputs.snmp.field]]
name = "currconns"
oid = ".1.3.6.1.4.1.2620.1.1.25.3.0"
conversion = "int"

[[inputs.snmp.field]]
name = "hmem_failed"
oid = ".1.3.6.1.4.1.2620.1.1.26.1.21.0"

[[inputs.snmp.field]]
name = "kmem_failed"
oid = ".1.3.6.1.4.1.2620.1.1.26.2.15.0"
conversion = "int"

System info:

telegraf version : Telegraf vdev-112-g8bf193d (git: master 8bf193d)
kernel version : 2.6.18-411.0.0.0.1.el5

Steps to reproduce:

no data output by telegraf

telegraf -test -debug -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

  • Plugin: inputs.snmp, Collection 1
    [abc@xxxxx telegraf.d]

Expected behavior:

value of the oid.

snmpget -c public -v2c 10.xxx.xxx.xxx .1.3.6.1.4.1.2620.1.1.25.3.0
SNMPv2-SMI::enterprises.2620.1.1.25.3.0 = INTEGER: 129196

Actual behavior:

no data output

Additional info:

I have tried with below version with influxdb as output and still same
Telegraf v1.2.1 (git: release-1.2 3b6ffb3)

@ayounas ayounas changed the title snmp plugin does not output any data snmp plugin not producing any data Apr 4, 2017
@danielnelson
Copy link
Contributor

@phemmer Do you think this is a duplicate of #2590?

@phemmer
Copy link
Contributor

phemmer commented Apr 6, 2017

Not likely. Doesn't look like opaque values are in use here. At glance I don't see anything that would cause a problem. The conversion statements are unnecessary, but shouldn't cause problems.

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Apr 6, 2017
@ayounas
Copy link
Author

ayounas commented Apr 6, 2017

Yes the conversion statement are unnecessary because expected output is an int. This was just a stab in dark to find if conversion makes any difference.

@phemmer
Copy link
Contributor

phemmer commented Apr 8, 2017

Found the issue. PR is over at #2639
However you can work around the issue by just setting the name property. Example:

[[inputs.snmp]]
agents = [ "10.xx.xx.xx:161" ]
version = 2
timeout = "5s"
retries = 3
community = "public"
name = "snmp" # <-- this

@ayounas
Copy link
Author

ayounas commented Apr 9, 2017

Thanks for the help
snmp plugin is now producing data after adding name= "snmp" as suggested

telegraf -test -debug -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

  • Plugin: inputs.snmp, Collection 1

snmp,agent_host=10.xx.xx.xx,dc=DC1,hostname=checkpoint kmem_failed=0i,max_conns=1250140i,curr_conns=118678i,hmem_failed=0i 1491769764000000000

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

3 participants