Hi,
I am trying to achieve similar thing here. I want to only receive metrics for operational interfaces. I use ifXTable and ifTable, both tables have same indexes so there is no problem merging them.
I want to send data to Graphite.
This is my configuration:
Interface metrics
[[inputs.snmp.table]]
name=“interface”
[[inputs.snmp.table.field]]
name=“ifDescr”
oid=“IF-MIB::ifDescr”
is_tag=true
[[inputs.snmp.table.field]]
name=“ifOperStatus”
oid=“IF-MIB::ifOperStatus”
is_tag=true
[[inputs.snmp.table.field]]
name=“ifHCInOctets”
oid=“IF-MIB::ifHCInOctets”
[[inputs.snmp.table.field]]
name=“ifHCInUcastPkts”
oid=“IF-MIB::ifHCInUcastPkts”
[[inputs.snmp.table.field]]
name=“ifHCOutOctets”
oid=“IF-MIB::ifHCOutOctets”
[[inputs.snmp.table.field]]
name=“ifHCOutUcastPkts”
oid=“IF-MIB::ifHCOutUcastPkts”
[[inputs.snmp.table.field]]
name=“ifInDiscards”
oid=“IF-MIB::ifInDiscards”
[[inputs.snmp.table.field]]
name=“ifInErrors”
oid=“IF-MIB::ifInErrors”
[[inputs.snmp.table.field]]
name=“ifInUnknownProtos”
oid=“IF-MIB::ifInUnknownProtos”
[[inputs.snmp.table.field]]
name=“ifOutDiscards”
oid=“IF-MIB::ifOutDiscards”
[[inputs.snmp.table.field]]
name=“ifOutErrors”
oid=“IF-MIB::ifOutErrors”
[inputs.snmp.tagpass]
ifOperStatus=[“1”]
[inputs.snmp.tagdrop]
ifDescr=[“unrouted*”]
fieldpass = [“ifHCInOctets”, “ifHCInUcastPkts”, “ifHCOutUcastPkts”, “ifHCOutOctets”, “ifInDiscards”, “ifInErrors”, “ifInUnknownProtos”, “ifOutDiscards”, “ifOutErrors”]
tagexclude = [“ifOperStatus”]
I have two tags: ifDescr -for visualization and ifOperStatus -for filtering.
My goal here is to
- Allow metrics from only interfaces with ifOperStatus=1 (works)
- Deny all interfaces with description ifDescr=unrouted* (works)
- Cut tag ifOperStatus from the picture when sending data to Graphite (not working)
Line tagexclude = [“ifOperStatus”] seems do not take any effect.
In Graphite I get this picture:
But I would expect:
I have tried to put tag exclude to various places in the config but telegraf just failed to start. How I paste it is the only way it works.