snmp_exporter issue

253 views
Skip to first unread message

Abhiraj Verma

unread,
Jul 21, 2023, 10:22:21 AM7/21/23
to Prometheus Users


Getting this error white generating snmp.yml


ts=2023-07-19T15:55:45.342Z caller=main.go:136 level=error msg="Error generating config netsnmp" err="cannot find oid '1.3.6.1.4.1.9.9.109.1.1' to walk"

make: *** [Makefile:70: generate] Error 1




Disclaimer: This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward disclose or otherwise use it or any part of it in any way. To do so may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately.


Hemedi Salim

unread,
Jul 22, 2023, 6:46:29 AM7/22/23
to Abhiraj Verma, Prometheus Users
If you can break down how you are generating the snmp.yml. 
But Is like the you are missing the actual MIB file/OID in the directory you are generating from. 




--
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/4f319c78-6c34-4042-877f-282dea527744n%40googlegroups.com.

Abhiraj Verma

unread,
Jul 22, 2023, 10:02:22 AM7/22/23
to Prometheus Users
generator.yml
root@exporter:~/snmp_exporter/generator# cat generator.yml
---
# The generator config format version.
version: 2

auths:
  public_v1:
    version: 1
  public_v2:
    version: 2

modules:
  # Default IF-MIB interfaces table with ifIndex.
  cisco:
    #walk: [sysUpTime, interfaces, ifXTable,ciscoMemoryPoolUsed]
   # walk:  
    walk:
      - sysDescr
      - sysUpTime
      - sysName
      - interfaces
      - ifXTable
     # - cpmCPUTotalTable
     # - cieIfPacketStatsEntry
      - 1.3.6.1.2.1.2.2.1.1
      - 1.3.6.1.2.1.2.2.1.2
      - 1.3.6.1.2.1.2.2.1.10
      - 1.3.6.1.2.1.2.2.1.13
      - 1.3.6.1.2.1.2.2.1.14
      - 1.3.6.1.2.1.2.2.1.16
      - 1.3.6.1.2.1.2.2.1.19
      - 1.3.6.1.2.1.2.2.1.2
      - 1.3.6.1.2.1.2.2.1.20
      - 1.3.6.1.2.1.2.2.1.5
      - 1.3.6.1.2.1.2.2.1.7
      - 1.3.6.1.2.1.2.2.1.8
      - 1.3.6.1.2.1.31.1.1.1.1
      - 1.3.6.1.2.1.31.1.1.1.18
     # - 1.3.6.1.4.1.9.9.48.1.1.1.5
     # - 1.3.6.1.4.1.9.9.48.1.1.1.6
     # - 1.3.6.1.4.1.9.2.1
      - 1.3.6.1.2.1.1.5
      - 1.3.6.1.4.1.9.9.48.1.2
     # - 1.3.6.1.4.1.9.9.109.1.1 # Defined within Cisco private mib CISCO-PROCESS-MIB
    lookups:
      - source_indexes: [ifIndex]
        lookup: ifAlias
      - source_indexes: [ifIndex]
        lookup: ifDescr
      - source_indexes: [ifIndex]
        lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
   # lookups:
     # - source_indexes: [ifIndex]
      #  lookup: ifAlias
    #  - source_indexes: [ifIndex]
        # Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
   #     lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
  #    - source_indexes: [ifIndex]
        # Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
 #       lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
    overrides:
      ifAlias:
        ignore: true # Lookup metric
      ifDescr:
        ignore: true # Lookup metric
      ifName:
        ignore: true # Lookup metric
      ifType:
        type: EnumAsInfo

mibs folder path & Mibs 

root@exporter:~/snmp_exporter/generator# cd /usr/share/snmp/
root@exporter:/usr/share/snmp# ls
mib2c-data  mibs  mibs-downloader  snmpconf-data  snmp_perl.pl
root@exporter:/usr/share/snmp# cd mibs
root@exporter:/usr/share/snmp/mibs# ls
CISCO-MEMORY-POOL-MIB.text  NET-SNMP-EXAMPLES-MIB.txt         NET-SNMP-VACM-MIB.txt   UCD-DISKIO-MIB.txt
CISCO-PROCESS-MIB.text      NET-SNMP-EXTEND-MIB.txt           SNMP-COMMUNITY-MIB      UCD-DLMOD-MIB.txt
GNOME-SMI.txt               NET-SNMP-MIB.txt                  SNMP-FRAMEWORK-MIB      UCD-IPFILTER-MIB.txt
iana                        NET-SNMP-MONITOR-MIB.txt          SNMP-IEEE802-TM-MIB     UCD-IPFWACC-MIB.txt
ietf                        NET-SNMP-PASS-MIB.txt             SNMP-NOTIFICATION-MIB   UCD-SNMP-MIB-OLD.txt
IF-MIB                      NET-SNMP-PERIODIC-NOTIFY-MIB.txt  SNMP-TSM-MIB            UCD-SNMP-MIB.txt
LM-SENSORS-MIB.txt          NET-SNMP-SYSTEM-MIB.txt           SNMP-USER-BASED-SM-MIB
NET-SNMP-AGENT-MIB.txt      NET-SNMP-TC.txt                   UCD-DEMO-MIB.txt

Abhiraj Verma

unread,
Jul 22, 2023, 10:27:39 AM7/22/23
to Prometheus Users
snmpwalk output 

root@exporter:~# snmpwalk -v2c -c public 192.168.20.6  1.3.6.1.4.1.9.9.109.1.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.19 = INTEGER: 1000
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.3.19 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.4.19 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.5.19 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.6.19 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.19 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.19 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.9.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.10.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.11.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.12.19 = Gauge32: 1595908
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.13.19 = Gauge32: 2338884
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.14.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.15.19 = Gauge32: 2337548
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.16.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.17.19 = Counter64: 1595908
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.18.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.19.19 = Counter64: 2338884
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.20.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.21.19 = Counter64: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.22.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.23.19 = Counter64: 2337548
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.24.19 = Gauge32: 82
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.25.19 = Gauge32: 65
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.26.19 = Gauge32: 44
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.27.19 = Gauge32: 2543976
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.28.19 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.29.19 = Counter64: 2543976
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.2.19.0 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.2.19.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.2.19.2 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.2.19.3 = INTEGER: 3
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.3.19.0 = Gauge32: 6
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.3.19.1 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.3.19.2 = Gauge32: 2
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.3.19.3 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.4.19.0 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.4.19.1 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.4.19.2 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.4.19.3 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.5.19.0 = Gauge32: 5
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.5.19.1 = Gauge32: 3
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.5.19.2 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.2.1.5.19.3 = Gauge32: 4

Hemedi Salim

unread,
Jul 23, 2023, 8:21:22 AM7/23/23
to Abhiraj Verma, Prometheus Users
root@exporter:/usr/share/snmp/mibs# ls
CISCO-MEMORY-POOL-MIB.text  NET-SNMP-EXAMPLES-MIB.txt         NET-SNMP-VACM-MIB.txt   UCD-DISKIO-MIB.txt
CISCO-PROCESS-MIB.text      NET-SNMP-EXTEND-MIB.txt           SNMP-COMMUNITY-MIB      UCD-DLMOD-MIB.txt
GNOME-SMI.txt               NET-SNMP-MIB.txt                  SNMP-FRAMEWORK-MIB      UCD-IPFILTER-MIB.txt
iana                        NET-SNMP-MONITOR-MIB.txt          SNMP-IEEE802-TM-MIB     UCD-IPFWACC-MIB.txt
ietf                        NET-SNMP-PASS-MIB.txt             SNMP-NOTIFICATION-MIB   UCD-SNMP-MIB-OLD.txt
IF-MIB                      NET-SNMP-PERIODIC-NOTIFY-MIB.txt  SNMP-TSM-MIB            UCD-SNMP-MIB.txt
LM-SENSORS-MIB.txt          NET-SNMP-SYSTEM-MIB.txt           SNMP-USER-BASED-SM-MIB
NET-SNMP-AGENT-MIB.txt      NET-SNMP-TC.txt                   UCD-DEMO-MIB.txt


After that “ls” command you issued above, which MIB file are you using? Or is you MIB file there in that list!? 

If is not there, then you need to add the MIB file to directory first that contains the OIDs your looking then follow the process to generate the file again. Hope this will help.



Lam TAM

unread,
Nov 22, 2023, 10:54:44 AM11/22/23
to Prometheus Users

this is a good link for MIBs that can be downloaded

Reply all
Reply to author
Forward
0 new messages