SNMP Config either errors or doesn't deliver measurements

I am trying to set up some SNMP Inputs but just can’t get them to work.
What I have done:

I have set gosmi as the translator.

[agent]
  snmp_translator = "gosmi"

I downloaded the MIB files and placed them under “usr/share/snmp/mibs”.

And I have the following config:

[[inputs.snmp]]
  agents = ["udp://192.168.0.253:161"]
  agent_host_tag = "source"

  [[inputs.snmp.field]]
    name = "sip_account_status"
    oid = "1.3.6.1.4.1.53023.2.2.1.2"
    conversion = "int"

Running with this config results in no errors, but also no input in my Bucket.
If I try to test it using snmpget -v2c -c public 192.168.0.253 .1.3.6.1.4.1.53023.2.2.1.2 I get a lot of errors:

Cannot find module (SNMPv2-MIB): At line 1 in (none)
Cannot find module (IF-MIB): At line 1 in (none)
Cannot find module (IP-MIB): At line 1 in (none)
Cannot find module (TCP-MIB): At line 1 in (none)
Cannot find module (UDP-MIB): At line 1 in (none)
...
Cannot find module (SNMPv2-SMI): At line 6 in /usr/share/snmp/mibs/agfeo.mib
Did not find 'enterprises' in module #-1 (/usr/share/snmp/mibs/agfeo.mib)
Unlinked OID in AGFEO-PBX-MIB: agfeoMib ::= { enterprises 53023 }
Undefined identifier: enterprises near line 11 of /usr/share/snmp/mibs/agfeo.mib
Cannot adopt OID in AGFEO-PBX-MIB: agfeoCCfgSipAccountActive ::= { agfeoCCfgSipAccountEntry 3 }
Cannot adopt OID in AGFEO-PBX-MIB: agfeoCCfgSipAccountName ::= { agfeoCCfgSipAccountEntry 2 }
...

Am I missing something?

@Hipska In some other old post you mentioned you wrote a tool to generate telegraf configs from MIB files. Can you share that tool to help me exclude any mistakes in the table/field settings I would have to write manually?

That tool was for generating config to work with inputs.snmp_trap.

Anyway, if telegraf results in no errors, then you should see something when running telegraf with the --test argument…

It also looks like you are missing the basic MIBs to be able to run your snmpget command, but lets focus on telegraf first :wink:

I see, would have been too easy.

When I run a test it doesn’t return anything sadly:

# telegraf --test
2024-06-27T16:51:26Z I! Loading config: /etc/telegraf/telegraf.conf
2024-06-27T16:51:26Z I! Starting Telegraf 1.31.0 brought to you by InfluxData the makers of InfluxDB
2024-06-27T16:51:26Z I! Available plugins: 234 inputs, 9 aggregators, 32 processors, 26 parsers, 60 outputs, 6 secret-stores
2024-06-27T16:51:26Z I! Loaded inputs: snmp
2024-06-27T16:51:26Z I! Loaded aggregators: 
2024-06-27T16:51:26Z I! Loaded processors: 
2024-06-27T16:51:26Z I! Loaded secretstores: 
2024-06-27T16:51:26Z W! Outputs are not used in testing mode!
2024-06-27T16:51:26Z I! Tags enabled: host=192.168.0.167
#

Oh, am I missing some? I mapped the path to my MIBs using docker-compose, so there really are only the two ones I put in there.
Can I maybe download the basic ones from somewhere? Couldn’t find them in the git repo on a short glance

And if you try with a simple oid like sysUptime for example?

I have no idea why I didn’t get any output or error in that specific configuration, but the problem was twofold.

Just like you said, I was missing the MIBs, so I downloaded a batch from some GitHub repo that had the basic ones.

Afterwards I used snmpwalk to figure out the correct OID and now it works!