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

lookup creates empty labels #1039

Closed
llamafilm opened this issue Nov 3, 2023 · 3 comments
Closed

lookup creates empty labels #1039

llamafilm opened this issue Nov 3, 2023 · 3 comments

Comments

@llamafilm
Copy link

llamafilm commented Nov 3, 2023

Host operating system: output of uname -a

Linux grafanatest-i-056a1b7f8d5405c62 5.19.0-1028-aws #29~22.04.1-Ubuntu SMP Tue Jun 20 19:12:11 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

snmp_exporter version: output of snmp_exporter -version

0.24.1

What device/snmpwalk OID are you using?

iBoot PDU
OID 1.3.6.1.4.1.1418.6.5

If this is a new device, please link to the MIB(s).

iboot-pdu.mib.txt

What did you do that produced an error?

I'm trying to use a lookup to add a label on each metric with the outlet name, but the labels end up as an empty string. My config is like this:

  iboot_pdu:
    walk:
      - 1.3.6.1.4.1.1418.6.5 # outletTable
    lookups:
      - source_indexes:
          - outletIndex
        lookup: outletName

What did you expect to see?

I want the results to look like this:

outletStatus{outletIndex="0",outletName="1-LightwareHDMI"} 1

What did you see instead?

With the lookup:

# HELP outletIndex  - 1.3.6.1.4.1.1418.6.5.1.1
# TYPE outletIndex gauge
outletIndex{outletIndex="0",outletName=""} 1
outletIndex{outletIndex="1",outletName=""} 2
outletIndex{outletIndex="2",outletName=""} 3
outletIndex{outletIndex="3",outletName=""} 4
outletIndex{outletIndex="4",outletName=""} 5
outletIndex{outletIndex="5",outletName=""} 6
outletIndex{outletIndex="6",outletName=""} 7
outletIndex{outletIndex="7",outletName=""} 8
# HELP outletName The name of the outlet up to 20 characters - 1.3.6.1.4.1.1418.6.5.1.2
# TYPE outletName gauge
outletName{outletIndex="0",outletName=""} 1
outletName{outletIndex="1",outletName=""} 1
outletName{outletIndex="2",outletName=""} 1
outletName{outletIndex="3",outletName=""} 1
outletName{outletIndex="4",outletName=""} 1
outletName{outletIndex="5",outletName=""} 1
outletName{outletIndex="6",outletName=""} 1
outletName{outletIndex="7",outletName=""} 1
# HELP outletStatus  - 1.3.6.1.4.1.1418.6.5.1.6
# TYPE outletStatus gauge
outletStatus{outletIndex="0",outletName=""} 1
outletStatus{outletIndex="1",outletName=""} 1
outletStatus{outletIndex="2",outletName=""} 1
outletStatus{outletIndex="3",outletName=""} 1
outletStatus{outletIndex="4",outletName=""} 1
outletStatus{outletIndex="5",outletName=""} 1
outletStatus{outletIndex="6",outletName=""} 0
outletStatus{outletIndex="7",outletName=""} 1

With no lookups:

# HELP outletIndex  - 1.3.6.1.4.1.1418.6.5.1.1
# TYPE outletIndex gauge
outletIndex{outletIndex="0"} 1
outletIndex{outletIndex="1"} 2
outletIndex{outletIndex="2"} 3
outletIndex{outletIndex="3"} 4
outletIndex{outletIndex="4"} 5
outletIndex{outletIndex="5"} 6
outletIndex{outletIndex="6"} 7
outletIndex{outletIndex="7"} 8
# HELP outletName The name of the outlet up to 20 characters - 1.3.6.1.4.1.1418.6.5.1.2
# TYPE outletName gauge
outletName{outletIndex="0",outletName="1-MacStudio"} 1
outletName{outletIndex="1",outletName="2-Mezzo-1"} 1
outletName{outletIndex="2",outletName="3-UltraStudio"} 1
outletName{outletIndex="3",outletName="4-MP-60"} 1
outletName{outletIndex="4",outletName="5-Mezzo-2"} 1
outletName{outletIndex="5",outletName="6-Core110f"} 1
outletName{outletIndex="6",outletName="Outlet-7"} 1
outletName{outletIndex="7",outletName="8-Roku"} 1
# HELP outletStatus  - 1.3.6.1.4.1.1418.6.5.1.6
# TYPE outletStatus gauge
outletStatus{outletIndex="0"} 1
outletStatus{outletIndex="1"} 1
outletStatus{outletIndex="2"} 1
outletStatus{outletIndex="3"} 1
outletStatus{outletIndex="4"} 1
outletStatus{outletIndex="5"} 1
outletStatus{outletIndex="6"} 0
outletStatus{outletIndex="7"} 1
$ snmpwalk -v2c -c netflixsnmp -On -m IBOOTPDU-MIB 10.37.155.163 enterprises.1418.6.5
.1.3.6.1.4.1.1418.6.5.1.1.0 = INTEGER: 1
.1.3.6.1.4.1.1418.6.5.1.1.1 = INTEGER: 2
.1.3.6.1.4.1.1418.6.5.1.1.2 = INTEGER: 3
.1.3.6.1.4.1.1418.6.5.1.1.3 = INTEGER: 4
.1.3.6.1.4.1.1418.6.5.1.1.4 = INTEGER: 5
.1.3.6.1.4.1.1418.6.5.1.1.5 = INTEGER: 6
.1.3.6.1.4.1.1418.6.5.1.1.6 = INTEGER: 7
.1.3.6.1.4.1.1418.6.5.1.1.7 = INTEGER: 8
.1.3.6.1.4.1.1418.6.5.1.2.0 = STRING: 1-MacStudio
.1.3.6.1.4.1.1418.6.5.1.2.1 = STRING: 2-Mezzo-1
.1.3.6.1.4.1.1418.6.5.1.2.2 = STRING: 3-UltraStudio
.1.3.6.1.4.1.1418.6.5.1.2.3 = STRING: 4-MP-60
.1.3.6.1.4.1.1418.6.5.1.2.4 = STRING: 5-Mezzo-2
.1.3.6.1.4.1.1418.6.5.1.2.5 = STRING: 6-Core110f
.1.3.6.1.4.1.1418.6.5.1.2.6 = STRING: Outlet-7
.1.3.6.1.4.1.1418.6.5.1.2.7 = STRING: 8-Roku
@llamafilm llamafilm changed the title index lookup shows empty string index lookup starting at 0 shows empty string Nov 4, 2023
@llamafilm
Copy link
Author

llamafilm commented Nov 4, 2023

It works fine with net-snmp (after I realized snmptable is not compatible with the -On option)

% snmptable -v2c -c netflixsnmp -m IBOOTPDU-MIB 10.37.155.163 1.3.6.1.4.1.1418.6.5 
SNMP table: IBOOTPDU-MIB::outletTable

 outletIndex    outletName outletInitialState outletCycleTime outletControl outletStatus outletActualStatus
           1   1-MacStudio               last              10            on           on                 on
           2     2-Mezzo-1               last              10            on           on                 on
           3 3-UltraStudio               last              10            on           on                 on
           4       4-MP-60               last              10            on           on                 on
           5     5-Mezzo-2               last              10            on           on                 on
           6    6-Core110f               last              10            on           on                 on
           7      Outlet-7               last              10            on           on                 on
           8        8-Roku               last              10         cycle           on                 on

@llamafilm llamafilm changed the title index lookup starting at 0 shows empty string index lookup creates empty labels Nov 21, 2023
@llamafilm llamafilm changed the title index lookup creates empty labels lookup creates empty labels Nov 21, 2023
@llamafilm
Copy link
Author

This was caused by a duplicate outletName field in a different MIB. I fixed it by specifying the full OID in the lookup instead of just the name. This should be improved by #828

@SuperQ
Copy link
Member

SuperQ commented Dec 4, 2023

With the new multi-file module support, you can split your generator.yml into different parts and have a different MIBDIRS specification for each one. Then the exporter can load multiple lists of modules. This should make it easier to handle conflicting MIBs.

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