Why is snmp_exporter not recognizing the custom OID added?

95 views
Skip to first unread message

Awemnhd

unread,
Jan 13, 2024, 4:46:05 AM1/13/24
to Prometheus Users
Currently using snmp_exporter version 0.25.0

The problem I had with SNMPv3 has been solved by recompiling generator.yml!

However, the if_mib used by default uses the standard SMP management protocol. Some functions on network devices cannot be monitored. You need to add the manufacturer's private MIB OID value to be monitored, for example:
get:
    - 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5
   - 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7

-name: hwEntityCpuUsage
  oid: 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5
   type: Integer
   help: entity CPU usage value range: 0~100
-name: hwEntityMemUsage
   oid: 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.7
    type:Integer
   help:Machine memory usage, value range: 0~100

I loaded the above configuration section into the generator.yml file and recompiled it. The generated snmp.yml did not have the above configuration section. I manually added it to the compiled snmp.yml file. There was no error message at startup. Check /snmp?target= xx.xxx.xxx.xxx&auth=snmp_v3&module=if_mib, but I can’t see the oid I added get, even if I add the following configuration

walk:
    - 1.3.6.1.4.1.2011.5.25.31

Still can't see it after startup!

Final note: I can obtain the above OID values normally using snmpwalk in the same environment. How should I set snmp_exporter correctly?

Ben Kochie

unread,
Jan 13, 2024, 5:17:26 AM1/13/24
to Awemnhd, Prometheus Users
You need to look at your generator output. I'm guessing there were errors.

The HUAWEI-ENTITY-EXTENT-MIB OIDs you listed are in a table, so you can't get them, you need to walk them. When you generate, the output should have indexes that need to be used.

You need to make sure your vendor MIBs are added to your MIBDIRS path(s).

The output works just fine when I added your example MIB to a generator config.


--
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/9fcf5d63-20ca-45bb-8263-2a6e15302023n%40googlegroups.com.

Alexander Wilke

unread,
Jan 13, 2024, 6:30:39 AM1/13/24
to Prometheus Users
Keep in mind that you so Not only need the vendor specific MIBs but you need in Addition all MIBs which are listet at the to of the MIB as "IMPORTED".  So you maybe need other MIBs in the folder to have the complete OID path.

Maybe post:
- Your MIBs folder with the MIBs you use
- The Generator.yml you use
- The Generator command you use.
- The Output of the Generator 


I Like this Website to Download MIBs and IT tells me the other needed MIBs as "IMPORTED". I need These MIBs, too in the folder.


Message has been deleted

Awemnhd

unread,
Jan 14, 2024, 7:02:32 AM1/14/24
to Prometheus Users
Thank you. I will try to download the MIB file from this website later, but I have a question. Why does this website not mark the MIB file corresponding to the network device software version? The Huawei network device I use is the same model, but the OID is different in different software versions!

Alexander Wilke

unread,
Jan 14, 2024, 1:32:35 PM1/14/24
to Prometheus Users
Tell me the MIBs you want to use and maybe I can Tell you whats needed for Generator.yml and which additional MIBs are needed.
Reply all
Reply to author
Forward
0 new messages