telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

inputs.snmp not reaching out to collect metrics

Open Andrene opened this issue 10 months ago • 3 comments

Relevant telegraf.conf

[agent]
  interval = "10s"
  round_interval = true

  metric_batch_size = 10000

  metric_buffer_limit = 100000

  collection_jitter = "0s"

  flush_interval = "10s"

  flush_jitter = "0s"

  precision = "0s"
  debug = true
  snmp_translator = "gosmi"
  ## Override default hostname, if empty use os.Hostname()
  hostname = ""
  ## If set to true, do no set the "host" tag in the telegraf agent.
  omit_hostname = false

[[outputs.file]]
  files = ["stdout"]

[[inputs.snmp]]
  agents = ["udp://ip-address:161"]
  version = 3
  sec_name = "User"
  auth_protocol = "SHA"
  auth_password = "AuthPass"
  sec_level = "authPriv"
  context_name = ""
  priv_protocol = "AES"
  priv_password = "PrivPass"
  agent_host_tag = "source"
  path = ["/home/me/.snmp/mibs"]

  [[inputs.snmp.table]]
    name = "cpu"
    oid = "1.3.6.1.4.1.14823.2.2.1.2.1.13"
    index_as_tag = true

Logs from Telegraf

[me@metestbox ~]$ telegraf  --config minimal.telegraf.conf --debug
2025-01-31T19:41:11Z I! Loading config: minimal.telegraf.conf
2025-01-31T19:41:11Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2025-01-31T19:41:11Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2025-01-31T19:41:11Z I! Loaded inputs: snmp
2025-01-31T19:41:11Z I! Loaded aggregators:
2025-01-31T19:41:11Z I! Loaded processors:
2025-01-31T19:41:11Z I! Loaded secretstores:
2025-01-31T19:41:11Z I! Loaded outputs: file
2025-01-31T19:41:11Z I! Tags enabled: host=metestbox
2025-01-31T19:41:11Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"metestbox", Flush Interval:10s
2025-01-31T19:41:11Z D! [agent] Initializing plugins
2025-01-31T19:41:13Z D! [agent] Connecting outputs
2025-01-31T19:41:13Z D! [agent] Attempting connection to [outputs.file]
2025-01-31T19:41:13Z D! [agent] Successfully connected to outputs.file
2025-01-31T19:41:13Z D! [agent] Starting service inputs
2025-01-31T19:41:23Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:41:33Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:41:43Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:41:53Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:42:03Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:42:13Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
^C2025-01-31T19:42:13Z D! [agent] Stopping service inputs
2025-01-31T19:42:13Z D! [agent] Input channel closed
2025-01-31T19:42:13Z I! [agent] Hang on, flushing any cached metrics before shutdown
2025-01-31T19:42:13Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-01-31T19:42:13Z I! [agent] Stopping running outputs
2025-01-31T19:42:13Z D! [agent] Stopped Successfully

System info

Telegraf 1.33.0, RHEL 9.5

Docker

No response

Steps to reproduce

  1. Install AOS 8.10 mibs in snmp mibs path
  2. Start tcpdump looking for port 161 traffic
  3. Run minimal.telegraf.conf against a Aruba 9240 WIreless controller

Expected behavior

Metrics are collected by telegraf and network traffic is observed in tcpdump

Actual behavior

No metrics are collected and no network traffic is observed

Additional info

This was working when I was using the net-snmp translator, but I've since moved over to gosmi.

Theres no logging telegraf side that indicates it's unhappy with anything I've set so not sure why its not even attempting to reach out

Andrene avatar Jan 31 '25 19:01 Andrene

@Andrene are you sure you can reach the SNMP endpoint from your Docker container at all? Could you try with e.g. the SNMP tools?

srebhan avatar Mar 04 '25 16:03 srebhan

Hello,

Not using docker at all, just RHEL physical and virtual hosts. I am able to reach the endpoint using normal net-snmp commands, and if I comment out the gosmi translator so that it uses the netsnmp translator it does grab data

[me@metestbox ~]$ telegraf --config minimal.telegraf.conf
2025-03-04T17:15:53Z I! Loading config: minimal.telegraf.conf
2025-03-04T17:15:53Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2025-03-04T17:15:53Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2025-03-04T17:15:53Z I! Loaded inputs: snmp
2025-03-04T17:15:53Z I! Loaded aggregators:
2025-03-04T17:15:53Z I! Loaded processors:
2025-03-04T17:15:53Z I! Loaded secretstores:
2025-03-04T17:15:53Z I! Loaded outputs: file
2025-03-04T17:15:53Z I! Tags enabled: host=metestbox
2025-03-04T17:15:53Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"metestbox", Flush Interval:10s
2025-03-04T17:15:53Z D! [agent] Initializing plugins
2025-03-04T17:15:53Z D! [inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "-m" "all" "1.3.6.1.4.1.14823.2.2.1.2.1.13"
2025-03-04T17:15:54Z D! [inputs.snmp] executing "snmptranslate" "-Td" "WLSX-SYSTEMEXT-MIB::wlsxSysExtProcessorTable.1"
2025-03-04T17:15:54Z D! [inputs.snmp] executing "snmptable" "-Ch" "-Cl" "-c" "public" "127.0.0.1" "WLSX-SYSTEMEXT-MIB::wlsxSysExtProcessorTable"
2025-03-04T17:15:54Z D! [inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "WLSX-SYSTEMEXT-MIB::sysExtProcessorDescr"
2025-03-04T17:15:54Z D! [inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "WLSX-SYSTEMEXT-MIB::sysExtProcessorLoad"
2025-03-04T17:15:54Z D! [agent] Connecting outputs
2025-03-04T17:15:54Z D! [agent] Attempting connection to [outputs.file]
2025-03-04T17:15:54Z D! [agent] Successfully connected to outputs.file
2025-03-04T17:15:54Z D! [agent] Starting service inputs
cpu,host=metestbox,index=18,source=ip-address sysExtProcessorDescr="Network Processor CPU18",sysExtProcessorLoad=3i 1741108560000000000
cpu,host=metestbox,index=14,source=ip-address sysExtProcessorDescr="Network Processor CPU14",sysExtProcessorLoad=24i 1741108560000000000
cpu,host=metestbox,index=15,source=ip-address sysExtProcessorDescr="Network Processor CPU15",sysExtProcessorLoad=27i 1741108560000000000
cpu,host=metestbox,index=9,source=ip-address sysExtProcessorDescr="Network Processor CPU9",sysExtProcessorLoad=8i 1741108560000000000
cpu,host=metestbox,index=11,source=ip-address sysExtProcessorDescr="Network Processor CPU11",sysExtProcessorLoad=36i 1741108560000000000
cpu,host=metestbox,index=17,source=ip-address sysExtProcessorDescr="Network Processor CPU17",sysExtProcessorLoad=3i 1741108560000000000
cpu,host=metestbox,index=1,source=ip-address sysExtProcessorDescr="Supervisor Card CPU",sysExtProcessorLoad=16i 1741108560000000000
cpu,host=metestbox,index=8,source=ip-address sysExtProcessorDescr="Network Processor CPU8",sysExtProcessorLoad=1i 1741108560000000000
cpu,host=metestbox,index=12,source=ip-address sysExtProcessorDescr="Network Processor CPU12",sysExtProcessorLoad=26i 1741108560000000000
cpu,host=metestbox,index=13,source=ip-address sysExtProcessorDescr="Network Processor CPU13",sysExtProcessorLoad=27i 1741108560000000000
cpu,host=metestbox,index=16,source=ip-address sysExtProcessorDescr="Network Processor CPU16",sysExtProcessorLoad=28i 1741108560000000000
cpu,host=metestbox,index=10,source=ip-address sysExtProcessorDescr="Network Processor CPU10",sysExtProcessorLoad=26i 1741108560000000000
2025-03-04T17:16:04Z D! [outputs.file] Wrote batch of 12 metrics in 345.629µs
2025-03-04T17:16:04Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
^C2025-03-04T17:16:06Z D! [agent] Stopping service inputs
2025-03-04T17:16:06Z D! [agent] Input channel closed
2025-03-04T17:16:06Z I! [agent] Hang on, flushing any cached metrics before shutdown
2025-03-04T17:16:06Z D! [outputs.file] Buffer fullness: 0 / 100000 metrics
2025-03-04T17:16:06Z I! [agent] Stopping running outputs
2025-03-04T17:16:06Z D! [agent] Stopped Successfully

Andrene avatar Mar 04 '25 17:03 Andrene

If I specify the non-numeric oid it does yell at me that it can't translate it, so I'm guessing gosmi is having issues reading the mibs from the path specfied?

2025-03-04T18:01:30Z I! Loading config: minimal.telegraf.conf
2025-03-04T18:01:30Z I! Starting Telegraf 1.33.0 brought to you by InfluxData the makers of InfluxDB
2025-03-04T18:01:30Z I! Available plugins: 236 inputs, 9 aggregators, 33 processors, 26 parsers, 63 outputs, 6 secret-stores
2025-03-04T18:01:30Z I! Loaded inputs: snmp
2025-03-04T18:01:30Z I! Loaded aggregators:
2025-03-04T18:01:30Z I! Loaded processors:
2025-03-04T18:01:30Z I! Loaded secretstores:
2025-03-04T18:01:30Z I! Loaded outputs: file
2025-03-04T18:01:30Z I! Tags enabled: host=metestbox
2025-03-04T18:01:30Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"metestbox", Flush Interval:10s
2025-03-04T18:01:30Z D! [agent] Initializing plugins
2025-03-04T18:01:32Z E! [telegraf] Error running agent: could not initialize input inputs.snmp: initializing table cpu: translating: cannot translate WLSX-SYSTEMEXT-MIB::wlsxSysExtProcessorTable into a numeric OID, please ensure all imported MIBs are in the path

Andrene avatar Mar 04 '25 18:03 Andrene

Probably related to https://github.com/influxdata/telegraf/issues/10793

Can you try be specifying the table fields manually?

Hipska avatar Mar 06 '25 13:03 Hipska

You would be correct, I am hitting that issue.

Specifying the fields makes it work as expected.

Thanks!

Andrene avatar Mar 06 '25 20:03 Andrene

@srebhan this can be closed as duplicate of #10793

Hipska avatar Jun 27 '25 07:06 Hipska

Closing as duplicate of #10793.

srebhan avatar Jun 30 '25 13:06 srebhan