How can I set a custom tag in an SNMP plugin?
I like to have the tag “foo” present in every OID collected like so
hrStorageTable,agent_host=A.B.C.D,fs=/,foo=bar Used=100240i,Size=4056112i 1525764935000000000
Currently I have the following configured, but it’s not showing.
[agent]
omit_hostname = true
[[inputs.snmp]]
agents = [ “A.B.C.D” ]
version = 2
community = “XXXX”
interval = “300s”
timeout = “120s”
[[inputs.snmp.tags]]
foo = “bar”
[[inputs.snmp.table]]
name = “hrStorageTable”
inherit_tags = [ “foo” ]
[[inputs.snmp.table.field]]
name = “Used”
oid = “HOST-RESOURCES-MIB::hrStorageUsed”
[[inputs.snmp.table.field]]
name = “Size”
oid = “HOST-RESOURCES-MIB::hrStorageSize”
[[inputs.snmp.table.field]]
name = “fs”
oid = “HOST-RESOURCES-MIB::hrStorageDescr”
is_tag = true