Telegraf SNMP Cisco Switch

Hello everyone,

I am runing Telegraf and InfluxDB. My aim is to monitor few value on Cisco switch.
All works with below config:

[[inputs.snmp]]
  agents = ["192.168.10.11", "192.168.10.12"]
  version = 2
  community = "super_string"
  name = "snmp"
  interval = "60s"

[[inputs.snmp.field]]
   name = "hostname"
   oid = "RFC1213-MIB::sysName.0"
   is_tag = true

[[inputs.snmp.table]]
   name = "snmp"
   inherit_tags = [ "hostname" ]
   oid = "IF-MIB::ifXTable"

  [[inputs.snmp.table.field]]
     name = "ifName"
     oid = "IF-MIB::ifName"
     is_tag = true

As you can see I am pulling the whole ifXTable instead of this I would like to pull just two value for all interfaces in this table.
Value I am interesting are: IF-MIB::ifHCInOctets. and IF-MIB::ifHCOutOctets

Can someone help me to configure it?

I will reply to my own question maybe someone will find it usefull


[[inputs.snmp]]
  agents = ["192.168.10.11",]
  version = 2
  community = "single_nucleotide"
  name = "snmp"
  interval = "60s"

[[inputs.snmp.field]]
   name = "hostname"
   oid = "RFC1213-MIB::sysName.0"
   is_tag = true

[[inputs.snmp.table]]
   name = "Octets_field"
   inherit_tags = [ "hostname" ]

  [[inputs.snmp.table.field]]
     oid = "IF-MIB::ifHCInOctets"

  [[inputs.snmp.table.field]]
     oid = "IF-MIB::ifHCOutOctets"

[[inputs.snmp.table.field]]
   name = "ifName"
   oid = "IF-MIB::ifName"
   is_tag = true
2 Likes

Helllo @benek984,
Thank you for sharing your solution with the community!