Problems with snmp_exporter generator

1,265 views
Skip to first unread message

Thorben Köller

unread,
Apr 19, 2021, 5:38:22 AM4/19/21
to Prometheus Users

Hi all,

I am setting up a monitoring system using prometheus. This is mostly working well.
But I do have a problem with the setup of the snmp devices.

I have installed the snmp_exporter and built the matching generator. When I try to generate a snmp.yml I do neither get a file nor an error.

I only get this message (or similar):
level=info ts=2021-04-16T13:32:00.891Z caller=net_snmp.go:144 msg="Loading MIBs" from=$HOME/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf

Can anyone point me in the right direction to fix this? I have found nothing so far.

Regards
Thorben

Ben Kochie

unread,
Apr 19, 2021, 6:42:47 AM4/19/21
to Thorben Köller, Prometheus Users
Where are you MIBs installed? If you're using the Makefile to do "make mibs", you will need to adjust the environment variable MIBDIRS.

Something like this:

make mibs
export MIBDIRS=mibs
./generator parse_errors
./generator generate


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8c69852c-8bf1-4cc4-88c8-81694bac0ec1n%40googlegroups.com.

Thorben Köller

unread,
Apr 19, 2021, 7:49:01 AM4/19/21
to Prometheus Users
The MIBs are all in /usr/local/share/snmp/mibs. Reading the info that I get as normal user this should be the place that gets searched.
I have to use MIBs that are not implied in the make mibs command though.

Ben Kochie

unread,
Apr 19, 2021, 8:44:32 AM4/19/21
to Thorben Köller, Prometheus Users
As you can see by the original command output, you can specify multiple directories in the MIBDIRS var, similar to how you would use the PATH env.

Your system default appears to be MIBDIRS=$HOME/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf

Thorben Köller

unread,
Apr 23, 2021, 2:00:53 AM4/23/21
to Prometheus Users
Ok, I have made no progress so far (copied the files to relevant directories). But just for clarification: this is rather a problem with the MIBs than the snmp exporter generator, isn't it?

Thorben Köller

unread,
Apr 23, 2021, 4:37:57 AM4/23/21
to Prometheus Users
Update: I would rule out any significant problems with the MIBs. I have once more rechecked that all required MIBs are present with fitting names and snmptranslate works fine for "non standard" MIBs.
Do you have another idea, what I could check?

Ben Kochie

unread,
Apr 23, 2021, 6:09:51 AM4/23/21
to Thorben Köller, Prometheus Users
Did you run "generator parse_errors" to validate parsing of all MIBs?

Thorben Köller

unread,
Apr 23, 2021, 8:14:15 AM4/23/21
to Prometheus Users
generetaor parse_errors gives me the same output as generate.
Reply all
Reply to author
Forward
0 new messages