Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The generator is unable to generate snmp configuration for Cisco network devices #1009

Closed
ktpktr0 opened this issue Sep 22, 2023 · 0 comments

Comments

@ktpktr0
Copy link

ktpktr0 commented Sep 22, 2023

Host operating system: output of uname -a

Linux localhost.localdomain 4.18.0-477.15.1.el8_8.x86_64 #1 SMP Wed Jun 28 15:04:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

snmp_exporter version: output of snmp_exporter -version

snmp_exporter: 0.24.1

What device/snmpwalk OID are you using?

I used the same version of snmp generatorg to generate the snmp configuration, which works well on Huawei network devices, but I encountered a problem when trying to generate it on Cisco devices

What did you do that produced an error?

The following two errors are only part of it, and in fact, all items in the walk section indicate this error

docker run --rm -v "${PWD}:/opt/" prom/snmp-generator:v0.24.1 generate
ts=2023-09-22T13:51:00.555Z caller=net_snmp.go:162 level=info msg="Loading MIBs" from=mibs
ts=2023-09-22T13:51:03.523Z caller=main.go:122 level=warn msg="NetSNMP reported parse error(s)" errors=177939
ts=2023-09-22T13:51:03.523Z caller=main.go:53 level=info msg="Generating config for module" module=CISCO
ts=2023-09-22T13:51:03.523Z caller=main.go:132 level=error msg="Error generating config netsnmp" err="cannot find oid '1.3.6.1.2.1.1.3' to walk"

[root@localhost opt]# docker run --rm -v "${PWD}:/opt/" prom/snmp-generator:v0.24.1 generate
ts=2023-09-22T13:51:57.188Z caller=net_snmp.go:162 level=info msg="Loading MIBs" from=mibs
ts=2023-09-22T13:52:00.272Z caller=main.go:122 level=warn msg="NetSNMP reported parse error(s)" errors=177939
ts=2023-09-22T13:52:00.273Z caller=main.go:53 level=info msg="Generating config for module" module=CISCO
ts=2023-09-22T13:52:00.273Z caller=main.go:132 level=error msg="Error generating config netsnmp" err="cannot find oid '1.3.6.1.2.1.1.5' to walk"

What did you expect to see?

Successfully generated snmp.yml file

What did you see instead?

I obtained OID on the following website, but it seems to be working improperly

https://snmp.cloudapps.cisco.com/Support/SNMP/do/BrowseOID.do?objectInput=IfDescr&translate=Translate&submitValue=SUBMIT&submitClicked=true

At the same time, it seems that the keyword also exists in the mib file I downloaded in the current directory

grep sysUpTime mibs/*

mibs/OLD-CISCO-CHASSIS-MIB:sysUpTimeAtLastChassisChange OBJECT-TYPE
mibs/SNMPv2-MIB.my:   sysUpTime OBJECT-TYPE
mibs/SNMPv2-MIB.my:               "The value of sysUpTime at the time of the most recent
mibs/SNMPv2-MIB.my:               "The value of sysUpTime at the time this conceptual
mibs/SNMPv2-MIB.my:       OBJECTS { sysDescr, sysObjectID, sysUpTime,

grep sysName mibs/*

mibs/CISCO-PAGP-MIB:        sysName value of the device sending the packet.
mibs/CISCOSB-CDP-MIB:            "The sysName MIB as will be advertised in subsequent CDP messages."
mibs/CISCOSB-UDLD-MIB:        "The Neighbor NeighborDevice Name TLV should contain sysName in ACSII."
mibs/CISCO-VTP-MIB:            "sysName of the VTP member."
mibs/SNMPv2-MIB.my:   sysName OBJECT-TYPE
mibs/SNMPv2-MIB.my:                 sysContact, sysName, sysLocation,

This is my generator.yml configuration file

auths:
  pub:
    version: 2
    community: test

modules:
  CISCO:
    walk:
      - 1.3.6.1.4.1.9.9.27                  #sysDescr
      - 1.3.6.1.2.1.1.3                     #sysUpTime
      - 1.3.6.1.2.1.1.5                     #sysName
      - 1.3.6.1.2.1.2.1                     #ifNumber
      - 1.3.6.1.2.1.2.2.1.1                 #ifIndex
      - 1.3.6.1.2.1.2.2.1.2                 #IfDescr
      - 1.3.6.1.2.1.2.2.1.3                 #ifType
      - 1.3.6.1.2.1.2.2.1.5                 #ifSpeed
      - 1.3.6.1.2.1.31.1.1.1.15             #ifHighSpeed
      - 1.3.6.1.2.1.31.1.1.1.18             #ifAlias
      - 1.3.6.1.2.1.2.2.1.8                 #ifOperStatus
      - 1.3.6.1.2.1.2.2.1.13                #ifInDiscards
      - 1.3.6.1.2.1.2.2.1.14                #ifInErrors
      - 1.3.6.1.2.1.2.2.1.19                #ifOutDiscards
      - 1.3.6.1.2.1.2.2.1.20                #ifOutErrors
      - 1.3.6.1.2.1.31.1.1.1.1              #ifName
      - 1.3.6.1.2.1.2.2.1.10                #ifInOctets
      - 1.3.6.1.2.1.2.2.1.16                #ifOutOctets
      - 1.3.6.1.2.1.31.1.1.1.6              #ifHCInOctets
      - 1.3.6.1.2.1.31.1.1.1.10             #ifHCOutOctets
      - 1.3.6.1.2.1.47.1.1.1.1.1            #entPhysicalIndex
      - 1.3.6.1.2.1.47.1.1.1.1.7            #entPhysicalName      
      - 1.3.6.1.4.1.9.9.109.1.1.1.1.4       #cpmCPUTotal1min
      - 1.3.6.1.4.1.3076.2.1.2.25.1.2       #alGeneralGaugeCpuUtil
      - 1.3.6.1.4.1.3076.2.1.2.22.1.29      #alHardwareCpuTemp
      - 1.3.6.1.4.1.9.9.48.1.1.1.5          #ciscoMemoryPoolUsed
      - 1.3.6.1.4.1.9.9.48.1.1.1.6          #ciscoMemoryPoolFree
      - 1.3.6.1.4.1.9.9.117.1.4.2.1.1       #cefcFanSpeed
      - 1.3.6.1.4.1.9.2.2.1.1.2             #locIfLineProt
    max_repetitions: 3
    retries: 3
    timeout: 25s
 
    lookups:
      - source_indexes: [ifIndex]
        lookup: ifAlias
      - source_indexes: [ifIndex]
        lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
      - source_indexes: [ifIndex]
        lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
      - source_indexes: [entPhysicalIndex]
        lookup: 1.3.6.1.2.1.47.1.1.1.1.7 #entPhysicalName

    overrides:
      ifAlias:
        ignore: true # Lookup metric
      ifDescr:
        ignore: true # Lookup metric
      ifName:
        ignore: true # Lookup metric
      ifType:
        ignore: true # Lookup metric
      hillstoneTemperatureIndex:
        ignore: true
      hillstoneTemperatureDescr:
        ignore: true
@prometheus prometheus locked and limited conversation to collaborators Sep 22, 2023
@SuperQ SuperQ converted this issue into discussion #1010 Sep 22, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant