SNMP plugin not working

I’m having an issue polling a device with the problem that noting is getting written to the /tmp/snmp-microsemi.txt file.

telegraf agent version 1.27.2

telegraf config:

[agent]
  interval = "20s"
  round_interval = true
  metric_batch_size = 10000
  metric_buffer_limit = 10000
  flush_interval = "20s"
  flush_jitter = "0s"
  debug = true
  logfile = "/tmp/telegraf.log"
  omit_hostname = false

[[inputs.snmp]]
  agents = ["udp://192.168.103.232:161"]
  timeout = "10s"
  community = "microcommr"
  version = 2
  
  [[inputs.snmp.field]]
    oid = "RFC1213-MIB::sysName.0"
    name = "sysName"
    is_tag = true

  [[inputs.snmp.field]]
    name = "ntpSysLeap"
    oid = "S650::ntpSysLeap"

[[outputs.file]]
  files = ["/tmp/snmp-microsemi.txt"]

I can do an snmp walk and get the desired result verifying they mib is loaded:

snmpwalk -v 2c -c microcommr 192.168.103.232 S650::ntpSysLeap
S650::ntpSysLeap.0 = INTEGER: noWarning(0)
snmpwalk -v 2c -c microcommr 192.168.103.232 RFC1213-MIB::sysName
SNMPv2-MIB::sysName.0 = STRING: SyncServer
snmpwalk -v 2c -c microcommr 192.168.103.232 .1.3.6.1.4.1.9070.1.2.5.7.8.1.2
S650::ntpSysStratum.0 = INTEGER: 2

He debug file does not show any issues

[agent] Initializing plugins
[inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "RFC1213-MIB::sysName.0"
[inputs.snmp] executing "snmptranslate" "-Td" "-Ob" "S650::ntpSysLeap"
[agent] Connecting outputs
[agent] Attempting connection to [outputs.file]
[agent] Successfully connected to outputs.file
[agent] Starting service inputs
[outputs.file] Buffer fullness: 0 / 10000 metrics
[outputs.file] Buffer fullness: 0 / 10000 metrics
[outputs.file] Buffer fullness: 0 / 10000 metrics
[outputs.file] Buffer fullness: 0 / 10000 metrics
[outputs.file] Buffer fullness: 0 / 10000 metrics
[outputs.file] Buffer fullness: 0 / 10000 metrics

If I add the following using the enterprise oids then I get some data, but not from the manufacturer’s MIB.

  [[inputs.snmp.field]]
    name = "hostname"
    oid = "1.3.6.1.2.1.1.5.0"
    is_tag = true

  [[inputs.snmp.field]]
    name = "uptime"
    oid = "1.3.6.1.2.1.1.3.0"

text file:

snmp,agent_host=192.168.103.232,host=influxdb,hostname=SyncServer,sysName=SyncServer uptime=50832000i 1733764465000000000
snmp,agent_host=192.168.103.232,host=influxdb,hostname=SyncServer,sysName=SyncServer uptime=50832500i 1733764470000000000

I have seen post but not may solutions on this. Anyway to debug this process any better then just the debug option?

Can you try a couple things for me and see what the outcome is?

  1. agents = [“udp://192.168.103.232:161”] change to agents = [“192.168.103.232”]
  2. oid = “RFC1213-MIB::sysName.0” change to oid = “1.3.6.1.2.1.1.5.0”
  3. files = [“/tmp/snmp-microsemi.txt”] change to files = [“stdout”, “/tmp/snmp-microsemi.txt”]
  4. comment out the below section for now:

[[inputs.snmp.field]]
name = “ntpSysLeap”
oid = “S650::ntpSysLeap”

Also upgrading to a newer version would be a good idea.