Telegraf not loading the mib files

[telegraf] Error running agent: could not initialize input inputs.snmp: initializing field sysUpTime: translating: /etc/snmp/snmp.conf: line 2: Error: Blank line following mibs: token.
net-snmp: 1 error(s) in config file(s)
MIB search path: : /usr/share/snmp/mibs/
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (UCD-DISKIO-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (MTA-MIB): At line 0 in (none)
Cannot find module (NETWORK-SERVICES-MIB): At line 0 in (none)
/etc/snmp/snmp.conf: line 2: Error: Blank line following mibs: token.
net-snmp: 1 error(s) in config file(s)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
RFC1213-MIB::sysUpTime.0: Unknown Object Identifier: exit status 2

@Hipska or @Mya could either of you look at this one please?

It seems like you are using the netsnmp translator, but didn’t setup/configure Net-SNMP correctly first.

Either choose the gosmi translator or setup Net-SNMP correctly by testing if snmptranslate -On RFC1213-MIB::sysUpTime.0 returns the OID without any errors.

Thank you for your response. I did added the file under /etc/snmp/snmp.conf manually and mapped the mib folder path inside the snmp.conf.
Also stopped snmpd and snmptrapd services in local system.
Currently it works fine, but do still need to enable both snmpd and snmpdtrapd services? will this affect anything for the remote agents which is added in the telegraf.conf?

snmpd is for other system being able to get/set snmp OIDs from your host so that doesn’t seem to be needed?

snmptrapd is for receiving snmp traps on your system, but that can be done with telegraf also, it is up to you which tool you use for that.

Thank you for your confirmation @Hipska.

Just a last question for this mib files---- I see snmpwalk and snmptranslate works fine for most of the mib files, I do have more than 5000+ OIDs, I am finding difficult in adding each snmp.table.field for the mib files, is there any way to take all mib files from /usr/share/snmp/mibs and present in InfluxDB through Telegraf?

Thanks

For a similar situation, I created a small tool that reads the MIB files and generated the telegraf config…