Never mind, I figured this out, I wasn't properly using lookups within the
generator.yml file,
Here is the file that I was able to get it to properly work with, in case
anyone else runs into this issue:
modules:
cisco_router:
walk: # [sysUpTime, interfaces, ifXTable]
- 1.3.6.1.2.1.1.3 # UpTime
- 1.3.6.1.2.1.31.1.1.1.10 # Interface OutOctets
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
version: 3
timeout: 10s
auth:
username: <snipped>
security_level: authPriv
password: <snipped>
auth_protocol: SHA
priv_protocol: AES
priv_password: <snipped>
On Thursday, October 21, 2021 at 3:25:36 PM UTC-4 thunder196 wrote:
> Hi All,
>
> I have the following configuration within snmp_exporter:
>
> cisco_router:
> get:
> - 1.3.6.1.2.1.2.2.1.1.10
> - 1.3.6.1.2.1.2.2.1.2.10
> - 1.3.6.1.2.1.31.1.1.1.1.10
> - 1.3.6.1.2.1.31.1.1.1.10.10
> - 1.3.6.1.2.1.31.1.1.1.18.10
> metrics:
> - name: ifIndex
> oid: 1.3.6.1.2.1.2.2.1.1
> type: gauge
> help: A unique value, greater than zero, for each interface -
> 1.3.6.1.2.1.2.2.1.1
> indexes:
> - labelname: ifIndex
> type: gauge
> - name: ifDescr
> oid: 1.3.6.1.2.1.2.2.1.2
> type: DisplayString
> help: A textual string containing information about the interface -
> 1.3.6.1.2.1.2.2.1.2
> indexes:
> - labelname: ifIndex
> type: gauge
> - name: ifName
> oid: 1.3.6.1.2.1.31.1.1.1.1
> type: DisplayString
> help: The textual name of the interface - 1.3.6.1.2.1.31.1.1.1.1
> indexes:
> - labelname: ifIndex
> type: gauge
> - name: ifHCOutOctets
> oid: 1.3.6.1.2.1.31.1.1.1.10
> type: counter
> help: The total number of octets transmitted out of the interface,
> including framing
> characters - 1.3.6.1.2.1.31.1.1.1.10
> indexes:
> - labelname: ifIndex
> type: gauge
> - name: ifAlias
> oid: 1.3.6.1.2.1.31.1.1.1.18
> type: DisplayString
> help: This object is an 'alias' name for the interface as specified by
> a network
> manager, and provides a non-volatile 'handle' for the interface -
> 1.3.6.1.2.1.31.1.1.1.18
> indexes:
> - labelname: ifIndex
> type: gauge
> version: 3
> timeout: 10s
> auth:
> security_level: authPriv
> username: <snipped>
> password: <snipped>
> auth_protocol: SHA
> priv_protocol: AES
> priv_password: <snipped>
>
>
>
> According to the snmp_exporter docs about mapping:
> https://github.com/prometheus/snmp_exporter#mapping
>
> This should result in a singular line output like:
>
> ifHCOutOctets{ifAlias="",ifDescr="eth0",ifIndex="2",ifName="eth0"} 1000
>
> However this doesn't seem to be happening as I get:
>
> # HELP ifAlias This object is an 'alias' name for the interface as
> specified by a network manager, and provides a non-volatile 'handle' for
> the interface - 1.3.6.1.2.1.31.1.1.1.18
> # TYPE ifAlias gauge
> ifAlias{ifAlias="",ifIndex="10"} 1
> # HELP ifDescr A textual string containing information about the interface
> - 1.3.6.1.2.1.2.2.1.2
> # TYPE ifDescr gauge
> ifDescr{ifDescr="<snipped> 0/1/2",ifIndex="10"} 1
> # HELP ifIndex A unique value, greater than zero, for each interface -
> 1.3.6.1.2.1.2.2.1.1
> # TYPE ifIndex gauge
> ifIndex{ifIndex="10"} 10
> # HELP ifName The textual name of the interface - 1.3.6.1.2.1.31.1.1.1.1
> # TYPE ifName gauge
> ifName{ifIndex="10",ifName="<snipped> 0/1/2"} 1
> # HELP snmp_scrape_duration_seconds Total SNMP time scrape took (walk and
> processing).
> # TYPE snmp_scrape_duration_seconds gauge
> snmp_scrape_duration_seconds 0.068588273
> # HELP snmp_scrape_pdus_returned PDUs returned from walk.
> # TYPE snmp_scrape_pdus_returned gauge
> snmp_scrape_pdus_returned 4
> # HELP snmp_scrape_walk_duration_seconds Time SNMP walk/bulkwalk took.
> # TYPE snmp_scrape_walk_duration_seconds gauge
> snmp_scrape_walk_duration_seconds 0.068496554
>
>
> Anyone know why this isn't working as intended?
>
>
> Here is the generator.yml file as well:
>
> modules:
> cisco_router:
> walk:
> - 1.3.6.1.2.1.2.2.1.1.10 # Interface Index
> - 1.3.6.1.2.1.2.2.1.2.10 # Interface Descriptions
> - 1.3.6.1.2.1.31.1.1.1.1.10 # Interface Name
> - 1.3.6.1.2.1.31.1.1.1.10.10 # Interface OutOctets
> - 1.3.6.1.2.1.31.1.1.1.18.10 # Interface Alias
> version: 3
> timeout: 10s
>
> auth:
> username: <snipped>
> security_level: authPriv
> password: <snipped>
> auth_protocol: SHA
> priv_protocol: AES
> priv_password: <snipped>
>
--
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/4e3279d9-1bd5-4a5f-a2f9-31c5da0c87c5n%40googlegroups.com.