I have an SNMP device that returns a value like this:
DOLBY-CP850-MIB::cp850MeterLevels.0 = STRING: "00 00 00 00 00 00 00 00 00 00"
This string represents the volume level of 10 separate audio channels, so I would like to break it apart and record it as 10 metrics. I previously had this working in Telegraf so the result looked like this:
snmp_dolby_cp_meter_level_dbfs{channel="L"} 0
snmp_dolby_cp_meter_level_dbfs{channel="R"} 0
snmp_dolby_cp_meter_level_dbfs{channel="C"} 0
snmp_dolby_cp_meter_level_dbfs{channel="LFE"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Lss"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Rss"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Lrs"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Rrs"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Lts"} 0
snmp_dolby_cp_meter_level_dbfs{channel="Rts"} 0
Is this possible to do with snmp-exporter? I couldn't find any way to add the channel label. The best I could think of is this regex_extract in the exporter, but this isn't really what I want because it adds the channel identifier to the metric name.
cp850MeterLevels:
type: DisplayString
regex_extracts:
'_L':
- regex: '(..) .. .. .. .. .. .. .. .. ..'
value: $1
'_R':
- regex: '.. (..) .. .. .. .. .. .. .. ..'
value: $1
'_C':
- regex: '.. .. (..) .. .. .. .. .. .. ..'
value: $1
'_LFE':
- regex: '.. .. .. (..) .. .. .. .. .. ..'
value: $1
'_Lss':
- regex: '.. .. .. .. (..) .. .. .. .. ..'
value: $1
'_Rss':
- regex: '.. .. .. .. .. (..) .. .. .. ..'
value: $1
'_Lrs':
- regex: '.. .. .. .. .. .. (..) .. .. ..'
value: $1
'_Rrs':
- regex: '.. .. .. .. .. .. .. (..) .. ..'
value: $1
'_Lts':
- regex: '.. .. .. .. .. .. .. .. (..) ..'
value: $1
'_Rts':
- regex: '.. .. .. .. .. .. .. .. .. (..)'
value: $1