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.

On Tue, May 16, 2023 at 9:40 PM Erv Moeckel <[email protected]> wrote:

> 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"
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/60a0c798-a736-48d1-a4a9-6dd7773d11e5n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/60a0c798-a736-48d1-a4a9-6dd7773d11e5n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CABbyFmoDVffkvdAHpkRo3CUewMLc9_cm36OMrQWOaUH8e2L4sw%40mail.gmail.com.

Reply via email to