This is the base SNMP config for Barco projector, with string fields recorded as tags.
[agent]
omit_hostname = true
snmp_translator = "gosmi"
quiet = true
[[inputs.snmp]]
alias = "5913"
name_override = "snmp_barco_projector"
path = ["$MIBDIRS"]
agents = ["10.37.156.50"]
version = 2
community = "public"
agent_host_tag = "source"
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::projWarnings.0'
name = 'projWarnings'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::barcoPackageVersion.0'
name = 'barcoPackageVersion'
is_tag = true
[[inputs.snmp.field]]
oid = '.1.3.6.1.4.1.12612.220.11.2.2.4.8.1.2.1'
name = 'lampRunTime'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::presetActive.0'
name = 'presetActive'
is_tag = true
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::projErrors.0'
name = 'projErrors'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::projNotif.0'
name = 'projNotif'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::projRunTime.0'
name = 'projRunTime'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::dowserPosition.0'
name = 'dowserPosition'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::barcoPackageVersion.0'
name = 'barcoPackageVersion'
is_tag = true
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::projS2PowerMode.0'
name = 'projS2PowerMode'
[[inputs.snmp.field]]
oid = '.1.3.6.1.4.1.12612.220.11.2.2.4.8.1.2.1'
name = 'lampRunTime'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampStatus.0'
conversion = 'int'
name = 'lampStatus'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampMode.0'
name = 'lampMode'
conversion = 'enum'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampStrikes.0'
name = 'lampStrikes'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampPower.0'
name = 'lampPower'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampCurrent.0'
name = 'lampCurrent'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampOutput.0'
name = 'lampOutput'
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::lampErrorStatus.0'
name = 'lampErrorStatus'
conversion = 'enum'
is_tag = true
[[inputs.snmp.field]]
oid = 'BARCO-ME-DCP-MIB::presetActive.0'
name = 'presetActive'
is_tag = true
[inputs.snmp.tags]
site = "site1"
room = "room"
description = "description"
netbox_id = "123"
source = "10.37.156.50"
[[outputs.file]]
files = ["stdout"]
data_format = "prometheus"
prometheus_compact_encoding = true
It produces this output:
> snmp_barco_projector,barcoPackageVersion=2.10.118,description=description,lampErrorStatus=lampOK,netbox_id=123,presetActive=HDMI_239,room=room,site=site1,source=10.37.156.50 dowserPosition=0i,lampCurrent=0i,lampOutput=0i,lampPower=0i,lampRunTime=1483i,lampStatus=0i,lampStrikes=384i,projErrors=0i,projNotif=0i,projRunTime=59442i,projS2PowerMode=1i,projWarnings=0i 1712588883000000000
In Prometheus format:
snmp_barco_projector_lampOutput{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_dowserPosition{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampCurrent{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projWarnings{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampStrikes{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 384
snmp_barco_projector_lampStatus{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampRunTime{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 1483
snmp_barco_projector_projErrors{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projNotif{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projRunTime{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 59442
snmp_barco_projector_lampPower{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projS2PowerMode{barcoPackageVersion="2.10.118",description="description",lampErrorStatus="lampOK",netbox_id="123",presetActive="HDMI_239",room="room",site="site1",source="10.37.156.50"} 1
Including all these "info" tags (barcoPackageVersion
, lampErrorStatus
, and presetActive
) on each metric doesn't make sense and increases cardinality. So I added these processors:
# add info metric with value 1
[[processors.defaults]]
namepass = ["snmp_barco_projector"]
[processors.defaults.fields]
info = 1
# create a separate "info" metric
[[processors.split]]
namepass = ["snmp_barco_projector"]
drop_original = true
[[processors.split.template]]
name = "snmp_barco_projector"
fields = ["info"]
tags = [
"source",
"presetActive",
"barcoPackageVersion",
"lampErrorStatus"]
[[processors.split.template]]
name = "snmp_barco_projector"
fields = [
"dowserPosition",
"lampCurrent",
"lampOutput",
"lampPower",
"lampRunTime",
"lampStatus",
"lampStrikes",
"projErrors",
"projNotif",
"projRunTime",
"projS2PowerMode",
"projWarnings"]
tags = ["source", "site", "room", "netbox_id", "description"]
Now the output is:
> snmp_barco_projector,barcoPackageVersion=2.10.118,lampErrorStatus=lampOK,presetActive=HDMI_239,source=10.37.156.50 info=1i 1712589097000000000
> snmp_barco_projector,description=description,netbox_id=123,room=room,site=site1,source=10.37.156.50 dowserPosition=0i,lampCurrent=0i,lampOutput=0i,lampPower=0i,lampRunTime=1483i,lampStatus=0i,lampStrikes=384i,projErrors=0i,projNotif=0i,projRunTime=59442i,projS2PowerMode=1i,projWarnings=0i 1712589097000000000
And in Prometheus:
snmp_barco_projector_info{barcoPackageVersion="2.10.118",lampErrorStatus="lampOK",presetActive="HDMI_239",source="10.37.156.50"} 1
snmp_barco_projector_lampOutput{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampStrikes{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 384
snmp_barco_projector_lampStatus{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projWarnings{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_dowserPosition{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampRunTime{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 1483
snmp_barco_projector_projS2PowerMode{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 1
snmp_barco_projector_lampPower{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_lampCurrent{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projRunTime{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 59442
snmp_barco_projector_projErrors{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0
snmp_barco_projector_projNotif{description="description",netbox_id="123",room="room",site="site1",source="10.37.156.50"} 0