SNMP EXPORTER GENERATOR ERRORS

546 views
Skip to first unread message

Mitchell Laframboise

unread,
Sep 9, 2024, 7:50:17 AM9/9/24
to Prometheus Users
I am trying to generate an snmp.yml and have removed all sections from the generator.yml except for if-mib and I'm getting all these parse errors and I don't know why.

./generator parse_errors
ts=2024-09-09T11:22:12.963Z caller=net_snmp.go:175 level=info msg="Loading MIBs" from=$HOME/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf
ts=2024-09-09T11:22:13.109Z caller=main.go:177 level=warn msg="NetSNMP reported parse error(s)" errors=36
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-STORAGE-MEDIA-TYPE-MIB from="At line 19 in /usr/share/snmp/mibs/ietf/VM-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IEEE8021-CFM-MIB from="At line 30 in /usr/share/snmp/mibs/ietf/TRILL-OAM-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=LLDP-MIB from="At line 35 in /usr/share/snmp/mibs/ietf/TRILL-OAM-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-SMF-MIB from="At line 28 in /usr/share/snmp/mibs/ietf/SMF-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-ENTITY-MIB from="At line 18 in /usr/share/snmp/mibs/ietf/ENTITY-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANAPowerStateSet-MIB from="At line 20 in /usr/share/snmp/mibs/ietf/ENERGY-OBJECT-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-OLSRv2-LINK-METRIC-TYPE-MIB from="At line 26 in /usr/share/snmp/mibs/ietf/OLSRv2-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-ENERGY-RELATION-MIB from="At line 22 in /usr/share/snmp/mibs/ietf/ENERGY-OBJECT-CONTEXT-MIB"
ts=2024-09-09T11:22:13.109Z caller=main.go:183 level=error msg="Missing MIB" mib=IANA-BFD-TC-STD-MIB from="At line 30 in /usr/share/snmp/mibs/ietf/BFD-STD-MIB"
ts=2024-09-09T11:22:13.232Z caller=tree.go:83 level=warn msg="Can't find augmenting node" augments=dot1agCfmMepEntry node=trillOamMepEntry
ts=2024-09-09T11:22:13.232Z caller=tree.go:83 level=warn msg="Can't find augmenting node" augments=dot1agCfmMepDbEntry node=trillOamMepDbEntry
MIB search path: /home/mitchell/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf
Cannot find module (IANA-STORAGE-MEDIA-TYPE-MIB): At line 19 in /usr/share/snmp/mibs/ietf/VM-MIB
Did not find 'IANAStorageMediaType' in module #-1 (/usr/share/snmp/mibs/ietf/VM-MIB)
Cannot find module (IEEE8021-CFM-MIB): At line 30 in /usr/share/snmp/mibs/ietf/TRILL-OAM-MIB
Cannot find module (LLDP-MIB): At line 35 in /usr/share/snmp/mibs/ietf/TRILL-OAM-MIB
Did not find 'dot1agCfmMdIndex' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'dot1agCfmMaIndex' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'dot1agCfmMepIdentifier' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'dot1agCfmMepEntry' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'dot1agCfmMepDbEntry' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'Dot1agCfmIngressActionFieldValue' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'Dot1agCfmEgressActionFieldValue' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'Dot1agCfmRemoteMepState' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'LldpChassisId' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'LldpChassisIdSubtype' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'LldpPortId' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Did not find 'LldpPortIdSubtype' in module #-1 (/usr/share/snmp/mibs/ietf/TRILL-OAM-MIB)
Bad operator (INTEGER): At line 73 in /usr/share/snmp/mibs/ietf/SNMPv2-PDU
Cannot find module (IANA-SMF-MIB): At line 28 in /usr/share/snmp/mibs/ietf/SMF-MIB
Did not find 'IANAsmfOpModeIdTC' in module #-1 (/usr/share/snmp/mibs/ietf/SMF-MIB)
Did not find 'IANAsmfRssaIdTC' in module #-1 (/usr/share/snmp/mibs/ietf/SMF-MIB)
Cannot find module (IANA-ENTITY-MIB): At line 18 in /usr/share/snmp/mibs/ietf/ENTITY-MIB
Did not find 'IANAPhysicalClass' in module #-1 (/usr/share/snmp/mibs/ietf/ENTITY-MIB)
Cannot find module (IANAPowerStateSet-MIB): At line 20 in /usr/share/snmp/mibs/ietf/ENERGY-OBJECT-MIB
Did not find 'PowerStateSet' in module #-1 (/usr/share/snmp/mibs/ietf/ENERGY-OBJECT-MIB)
Cannot find module (IANA-OLSRv2-LINK-METRIC-TYPE-MIB): At line 26 in /usr/share/snmp/mibs/ietf/OLSRv2-MIB
Did not find 'IANAolsrv2LinkMetricTypeTC' in module #-1 (/usr/share/snmp/mibs/ietf/OLSRv2-MIB)
Cannot find module (IANA-ENERGY-RELATION-MIB): At line 22 in /usr/share/snmp/mibs/ietf/ENERGY-OBJECT-CONTEXT-MIB
Did not find 'IANAEnergyRelationship' in module #-1 (/usr/share/snmp/mibs/ietf/ENERGY-OBJECT-CONTEXT-MIB)
Cannot find module (IANA-BFD-TC-STD-MIB): At line 30 in /usr/share/snmp/mibs/ietf/BFD-STD-MIB
Did not find 'IANAbfdDiagTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)
Did not find 'IANAbfdSessTypeTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)
Did not find 'IANAbfdSessOperModeTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)
Did not find 'IANAbfdSessStateTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)
Did not find 'IANAbfdSessAuthenticationTypeTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)
Did not find 'IANAbfdSessAuthenticationKeyTC' in module #-1 (/usr/share/snmp/mibs/ietf/BFD-STD-MIB)

I had this working on a different VM about 7 or 8 months ago and I followed the same steps to set it up.  I'm not sure why snmp mibs downloader didn't download all the mibs?


Ben Kochie

unread,
Sep 9, 2024, 8:33:48 AM9/9/24
to Mitchell Laframboise, Prometheus Users
Did you read the error messages?

Your MIBDIRS are missing a number of MIBs in order to satisfy all the requirements.

Either find the missing MIBs, or set the `MIBDIRS` env var to point at the generator example "mibs" dir that is created with `make mibs`.

--
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/44880315-e5ac-4ca3-9d74-2d6ac8ff82c7n%40googlegroups.com.

Mitchell Laframboise

unread,
Sep 9, 2024, 8:37:29 AM9/9/24
to Prometheus Users
Yes I did read it, I just never had to do this last time I set this up.  

Brian Candler

unread,
Sep 9, 2024, 10:35:52 AM9/9/24
to Prometheus Users
>  msg="Loading MIBs" from=$HOME/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf

If you do that, then it's your responsibility to download the mibs you need. "apt-get snmp-mibs-downloader" on Ubuntu/Debian will get a bunch, but I don't know if you'll have all the ones you need.

My preferred option is to type "make mibs" then "make".  The first will fetch all the mibs required by the sample generator.yml, into a subdirectory called "mibs".  The second will build snmp.yml from generator.yml using those mibs.

Once you have this working, you can then replace generator.yml with your own generator.yml, and run "make" again, if necessary dropping any additional mibs you need into the "mibs" subdirectory.

Mitchell Laframboise

unread,
Sep 9, 2024, 10:42:20 AM9/9/24
to Prometheus Users
Thank you.  I ended up just downloading the mibs from mibbrowser.online, they had them all.  But then I had a problem with SNMPv2-PDU that I couldn't figure out so I just replaced it with a good copy.  

Do you know how to edit the snmpd.conf file?  The access control part is kind of confusing

Brian Candler

unread,
Sep 9, 2024, 11:28:05 AM9/9/24
to Prometheus Users
I strongly advise you to use node_exporter rather than snmpd for collecting metrics from Linux hosts, unless there's something you can't get any other way (keepalived VRRP might be one example).

By "snmpd.conf ... access control" you might be asking how to create SNMPv2 communities and SNMPv3 users, or you might mean configuring view-based ACLs to limit what parts of the MIB tree they can see.
For the first, there are simple examples at https://nsrc.org/activities/agendas/en/nmm-4-days/netmgmt/en/snmp/exercises-snmp.html - scroll down to "Configuration of snmpd (server/agent)".  For view-based ACLs, if you really need that, you'll need to read the snmpd.conf manpage carefully.

But node_exporter FTW.
Reply all
Reply to author
Forward
0 new messages