You really helped me, I just don't know that indexes can be a list. Appreciate you very much.
在2022年12月7日星期三 UTC+8 16:14:39<Brian Candler> 写道: > OK, so you're writing snmp.yml by hand, without using generator, and > without access to the MIB files. This makes it harder. > > The examples you gave both seem to have two OID parts as their table index: > > SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6*.289.1* = INTEGER: 1 > SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6*.290.1* = INTEGER: 1 > SNMPv2-SMI::enterprises.2011.5.25.31.1.1.10.1.7*.0.0* = INTEGER: 1 > SNMPv2-SMI::enterprises.2011.5.25.31.1.1.10.1.7*.0.1* = INTEGER: 1 > > If we could see the MIB files then we could understand what they represent. > > Without the docs and without having such a device to test I can't really > help. However you could look at some of the examples in snmp.yml where the > table index has two parts and/or is more than one OID component: > > - name: upsAdvBatteryCurrentTableIndex > oid: 1.3.6.1.4.1.318.1.1.1.2.2.14.1.1 > type: gauge > help: The Battery Frame identifier - 1.3.6.1.4.1.318.1.1.1.2.2.14.1.1 > indexes: > - labelname: upsAdvBatteryCurrentTableIndex > type: gauge > - labelname: upsAdvBatteryCurrentIndex > type: gauge > > or: > > indexes: > - labelname: bsnAPDot3MacAddress > type: PhysAddress48 > * fixed_size: 6* > - labelname: bsnAPIfSlotId > type: gauge > > or > > indexes: > - labelname: virtualServerIndex > type: gauge > - labelname: realServerIndex > type: gauge > > On Wednesday, 7 December 2022 at 03:11:53 UTC [email protected] wrote: > >> Thanks @Brain :) >> >> Let me describe the problem in more detail. >> 1. It's a HUAWEI S5335-S48T4X, software,Version 5.170 (S5335 >> V200R019C10SPC500) >> 2. I do not have its MIB but just a OID doc, the OID of hwEntityFanState >> is 1.3.6.1.4.1.2011.5.25.31.1.1.10.1.7 >> 3. My snmp config is >> ``` >> switch_huawei_gen: >> version: 2 >> auth: >> community: foo >> retries: 0 >> timeout: 3m >> walk: >> - 1.3.6.1.4.1.2011.5.25.31.1.1.10.1.7 # fanStatus >> metrics: >> - name: devFanStatus >> oid: 1.3.6.1.4.1.2011.5.25.31.1.1.10.1.7 >> type: gauge >> help: The current state of the device fan. >> indexes: >> - labelname: entIndex >> type: OctetString >> enum_values: >> 1: normal >> 2: abnormal >> ``` >> 4. snmpwalk result: >> ``` >> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.10.1.7.0.0 = INTEGER: 1 >> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.10.1.7.0.1 = INTEGER: 1 >> ``` >> 5. curl -g 'locahost:9116/snmp?target=x.x.x.x&module=foo' >> ``` >> An error has occurred while serving metrics: >> >> 1 error(s) occurred: >> * collected metric "devFanStatus" { label:<name:"entIndex" value:"" > >> gauge:<value:1 > } was collected before with the same name and label values >> ``` >> >> I think the entIndex should be unique in OctetString, but snmp_exporter >> doesn't think so. >> How can I fix it? >> >> 在2022年12月6日星期二 UTC+8 22:23:59<Brian Candler> 写道: >> >>> What it says is, you're generating the same metric two or more times >>> (with identical set of labels): >>> >>> devPowerStatus{entIndex="0x2101"} 1 >>> >>> If you hit snmp_exporter with curl you should be able to confirm whether >>> or not this is the case. >>> >>> curl -g 'locahost:9116/snmp?target=x.x.x.x&module=foo' >>> >>> If that's the case, then you need to fix your exporter config. You >>> haven't shown your generator.yml nor described the MIBs you're reading, but >>> 2011 is the enterprise ID for Huawei. >>> >>> On Tuesday, 6 December 2022 at 13:23:01 UTC [email protected] wrote: >>> >>>> Hi everybody, I got a problem that the entIndex "289.1" can not be >>>> parsed correctly。 >>>> snmp_exporter html: >>>> ``` >>>> collected metric "devPowerStatus" { label:<name:"entIndex" >>>> value:"0x2101" > gauge:<value:1 > } was collected before with the same >>>> name >>>> and label values >>>> ``` >>>> >>>> >>>> snmpwalk 1.3.6.1.4.1.2011.5.25.31.1.1.18.1.6: >>>> ``` >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.289.1 = INTEGER: 1 >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.290.1 = INTEGER: 1 >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.291.1 = INTEGER: 1 >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.545.1 = INTEGER: 1 >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.546.1 = INTEGER: 1 >>>> SNMPv2-SMI::enterprises.2011.5.25.31.1.1.18.1.6.547.1 = INTEGER: 1 >>>> ``` >>>> snmp_exporter config: >>>> ``` >>>> - name: devPowerStatus >>>> oid: 1.3.6.1.4.1.2011.5.25.31.1.1.18.1.6 >>>> type: gauge >>>> help: The current state of the device power >>>> indexes: >>>> - labelname: entIndex >>>> type: OctetString >>>> implied: true >>>> ``` >>>> Something maybe wrong with the indexes config, could someone help me? >>>> >>> -- 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/081075dd-e79a-421e-8314-c882601b5d84n%40googlegroups.com.

