# \[solved\] Telegraf influxDB Cisco SNMP

**URL:** <https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf\
**Created:** [November 15, 2017, 7:11am UTC](https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107 "2017-11-15T07:11:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sniper](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sniper](https://community.influxdata.com/u/sniper)\
**Post date:** [November 15, 2017, 7:11am UTC](https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107/1 "2017-11-15T07:11:03Z")

</div>

Telegraf Cisco Switch

So I’m not able to get any SNMP data via telegraf today ☹ Kindly assist

1. Telegraf and InluxDB running on Ubuntu

2. SNMP and SNMPD updates done

3. Community string added, snmpd service restarted

4. snmpwalk command works fine for the Cisco switch

Telegraf does not collect data into influxDB

telegraf snmp config is below:  
[[inputs.snmp]]

agents = [“1.1.1.1:161”] # this is an example for a single snmp get  
version = 2  
community = “test” # The community to be used

[[inputs.snmp.field]] # Try to allways keep this block in order to include hostanme info in all your records inserted on the database  
name = “hostname”  
oid = “.1.3.6.1.2.1.1.5.0”  
is\_tag = true

[[inputs.snmp.table]] # this is an example for a snmp walk  
name = “interface\_statistics”  
inherit\_tags = [“hostname”] # See note below.  
[inputs.snmp.tagpass]  
ifName = [“[g|x]e-”,“ae”] # This is relevant for filtering unwanted records  
[[inputs.snmp.table.field]] # This is the ‘key’ of the table, the element that helps to differentiate each record on the table.  
name = “ifName”  
oid = “.1.3.6.1.2.1.31.1.1.1.1”  
is\_tag = true  
[[inputs.snmp.table.field]] # Get a element of the table  
name = “ifHCInOctets”  
oid = “.1.3.6.1.2.1.31.1.1.1.6”

telegraf --test does not show any measurement/ table created. Default system stats work fine!

Thanks

---

<div class="post-metadata">

**Author:** ![soniahcp](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@soniahcp](https://community.influxdata.com/u/soniahcp)\
**Post date:** [November 15, 2017, 7:24am UTC](https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107/2 "2017-11-15T07:24:47Z")

</div>

Hi!  
I was using the same plugin, and metrics and here you have my config:

[[inputs.snmp]]  
agents = [“xx.xx.xx.xx:161”,“xx.xx.xx.xx:161”]  
version = 2  
community = "comunity"  
name = “snmp”

```
[[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

```

With this is working fine.  
the only one difference is, Im collecting the entire table.  
try it!

---

<div class="post-metadata">

**Author:** ![sniper](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sniper](https://community.influxdata.com/u/sniper)\
**Post date:** [November 15, 2017, 10:50pm UTC](https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107/3 "2017-11-15T22:50:29Z")

</div>

You’re an angel, the above configuration worked! Again, I’m not an expert on how Telegraf collects data in this case but why does it work for a table and not singular ?

Thank you very much Sonia!

---

<div class="post-metadata">

**Author:** ![zmmalik](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/zmmalik/32/3950_2.png) [@zmmalik](https://community.influxdata.com/u/zmmalik)\
**Post date:** [May 31, 2020, 3:42am UTC](https://community.influxdata.com/t/solved-telegraf-influxdb-cisco-snmp/3107/4 "2020-05-31T03:42:26Z")

</div>

But if have to take data from a specific port only e.g. 1/0/1 then?
