Cisco UCS snmp_exporter error

262 views
Skip to first unread message

Erv Moeckel

unread,
May 16, 2023, 3:40:14 PM5/16/23
to Prometheus Users
Hello,

I have been working on generating a snmp.yml config for my UCS Central box. I have successfully pulled some information and got it working, but now I am looking at improving it. I am using a "conversation" from 2018 that looks promising. However, I am running into an error about not finding metrics in main.plain. I see that "metrics" has maybe been phased out, at least in the way it was used here. You will also see I am getting a "Can't find augmenting node", I have not been able to find much on that error, however my configs will generate if that is the only error. Please see below for my generator config and the error(s) that I got. Thanks in advance!

Config:
modules:
# Default IF-MIB interfaces table with ifIndex.
 if_mib_if_name:
   walk: [sysUpTime, interfaces, ifXTable]
   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
   auth:
     community: ***
 cisco_ucs:
  walk:
  - 1.3.6.1.4.1.9.9.719.1.1.1.1.16
  - 1.3.6.1.4.1.9.9.719.1.1.1.1.2
  metrics:
  - name: cucsFaultOccur
    oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.16
    type: counter
    help: Cisco UCS fault:Inst:occur managed object property - 1.3.6.1.4.1.9.9.719.1.1.1.1.16
    indexes:
    - labelname: cucsFaultDn
      type: gauge
    - labelname: cucsFaultTags
      type: OctetString
    lookups:
    - labels:
      - cucsFaultDn
      labelname: cucsFaultDn
      oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.2
      type: DisplayString
    - labels:
      - cucsFaultTags
      labelname: cucsFaultTags
      oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.21
      type: OctetString
  version: 2
  auth:
   community: ***



Errors:
ts=2023-05-16T19:05:24.910Z caller=net_snmp.go:161 level=info msg="Loading MIBs" from=/etc/snmp_exporter_generator/generator/mibs/
ts=2023-05-16T19:05:27.567Z caller=main.go:119 level=warn msg="NetSNMP reported parse error(s)" errors=1
ts=2023-05-16T19:05:28.302Z caller=tree.go:83 level=warn msg="Can't find augmenting node" augments=portCopyEntry node=portCopyXEntry
ts=2023-05-16T19:05:28.325Z caller=main.go:129 level=error msg="Error generating config netsnmp" err="error parsing yml config: yaml: unmarshal errors:\n  line 31: field metrics not found in type main.plain"

Brian Candler

unread,
May 16, 2023, 4:49:45 PM5/16/23
to Prometheus Users
It seems that "metrics:" is not a valid YAML key in generator.yml.  I guess you got this from copying the example in FORMAT.md ?


As for the message "Can't find augmenting node", net-snmp is complaining about the MIB, but as it's just a warning it might not cause any problem.

Brian Candler

unread,
May 16, 2023, 4:52:00 PM5/16/23
to Prometheus Users
Ergh, not enough sleep.

"metrics:" is valid in snmp.yml, but not in generator.yml.  If you put in in generator.yml then that's your problem.

Ben Kochie

unread,
May 17, 2023, 3:32:30 AM5/17/23
to Erv Moeckel, Prometheus Users
Yes, this syntax looks off.

It would help you describe what you're actually looking for (https://xyproblem.info/).

Looking at the MIB you're pulling from, CISCO-UNIFIED-COMPUTING-FAULT-MIB, you're looking for data under cucsFaultTable.

The only actual metric I see there is cucsFaultOccur.

I think this is the generator snipit you're looking for:
modules:
  cisco_ucs:
    walk:
    - cucsFaultOccur
    lookups:
    - source_indexes: [cucsFaultIndex]
      lookup: cucsFaultDn
    - source_indexes: [cucsFaultIndex]
      lookup: cucsFaultTags
    overrides:
      cucsFaultDn:
        type: DisplayString

NOTE: I had to override the Dn, since it's marked incorrectly in CISCO-UNIFIED-COMPUTING-MIB as an OCTET STRING.

This produces the snmp.yml:
# WARNING: This file was auto-generated using snmp_exporter generator, manual changes will be lost.

cisco_ucs:
  walk:
  - 1.3.6.1.4.1.9.9.719.1.1.1.1.16
  - 1.3.6.1.4.1.9.9.719.1.1.1.1.2
  - 1.3.6.1.4.1.9.9.719.1.1.1.1.21

  metrics:
  - name: cucsFaultOccur
    oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.16
    type: counter
    help: Cisco UCS fault:Inst:occur managed object property - 1.3.6.1.4.1.9.9.719.1.1.1.1.16
    indexes:
    - labelname: cucsFaultIndex
      type: gauge
    lookups:
    - labels:
      - cucsFaultIndex

      labelname: cucsFaultDn
      oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.2
      type: DisplayString
    - labels:
      - cucsFaultIndex
      labelname: cucsFaultTags
      oid: 1.3.6.1.4.1.9.9.719.1.1.1.1.21
      type: Bits


NOTE: Bits as OctetString was only merged recently and isn't in a production release yet. (https://github.com/prometheus/snmp_exporter/pull/870). So this configuration may actually cause a crash right now.

--
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/60a0c798-a736-48d1-a4a9-6dd7773d11e5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages