Skip to content
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

Lookups with different destination index names from source_indexes names? (ifIndex values, but under different name) #1050

Open
frittentheke opened this issue Nov 20, 2023 · 1 comment

Comments

@frittentheke
Copy link

I used the search function some, but could not find an answer to a problem I ran into:

Apparently some MIBs reuse the values of e.g. the popular ifIndex (IF-MIB), but under a different name.
Exhibit A(rista):

In their ARISTA-IP-MIB (https://www.arista.com/assets/data/docs/MIBS/ARISTA-IP-MIB.txt) the index aristaIpIfStatsIfIndex is defined with:

[...]
aristaIpIfStatsIfIndex OBJECT-TYPE
SYNTAX InterfaceIndex
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The index value that uniquely identifies the interface to
which this entry is applicable. The interface identified by
a particular value of this index is the same interface as
identified by the same value of the IF-MIB's ifIndex."
::= { aristaIpIfStatsEntry 2 }
[...]

So the snmp_exporter produces metrics like:

[...]
# HELP aristaIpIfStatsOutUcastPkts The number of IP unicast packets transmitted - 1.3.6.1.4.1.30065.3.27.1.1.1.9                                                                                                   
# TYPE aristaIpIfStatsOutUcastPkts counter                                                                                                                                                                         
aristaIpIfStatsOutUcastPkts{aristaIpIfStatsIPVersion="1",aristaIpIfStatsIfIndex="1000001"} 0                                                                                                                       
aristaIpIfStatsOutUcastPkts{aristaIpIfStatsIPVersion="1",aristaIpIfStatsIfIndex="1000002"} 0                                                                                                                       
aristaIpIfStatsOutUcastPkts{aristaIpIfStatsIPVersion="1",aristaIpIfStatsIfIndex="10001"} 0                                                                                                                         
aristaIpIfStatsOutUcastPkts{aristaIpIfStatsIPVersion="1",aristaIpIfStatsIfIndex="1000501"} 0     
[...]

Just like it's common for IF-MIB tables, I would like to lookup and add the ifName or ifAlias labels here. But as far as I understand the config of the generator's lookups (https://github.com/prometheus/snmp_exporter/blob/323d1b08578527d9ba0cdea7846c61942bb85e42/generator/generator.yml#L12C1-L12C1) functionality, the index defined by source_indexes has to exist under the same name in the table which fields are "joined"?

So my question are:

  • Can this be done with the current capabilities of the generator?
  • If not, would you add (or accept a PR) allowing to configure a different index field name than used for the source (in cases where the same values are actually used).
@SuperQ
Copy link
Member

SuperQ commented Nov 20, 2023

I don't remember a way to do this currently, but I think this would be useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants