On Wednesday, February 8, 2017 at 6:42:12 AM UTC-5, David Rawling wrote:
> I've been trying for a couple of days now to capture a small subset of the
> SNMP data published by a Cisco router. I'm trying to work out a way to
> capture the data by interface name (e.g. Et0) rather than SNMP OIDs - that
> way if something causes the interfaces to be renumbered, the data collection
> doesn't break.
>
> I've tried everything I can find, all without luck. Here's what I'm
> conceptually asking Telegraf to go get:
>
> [[inputs.snmp]]
> interval = "30s"
>
> [[inputs.snmp.host]]
> address = "W.X.Y.Z:161"
> version = 2
> community = "MyCommunity"
> collect = [ "interface", "bytesIn", "bytesOut" ]
>
> [[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"
> include_instances = [ 'Et0', 'Tu0' ]
>
> [[inputs.snmp.table.field]]
> name = "interface"
> oid = "IF-MIB::ifName"
> is_tag = true
>
> [[inputs.snmp.table.field]]
> name = "bytesIn"
> oid = "IF-MIB::ifHCInOctets"
>
> [[inputs.snmp.table.field]]
> name = "bytesOut"
> oid = "IF-MIB::ifHCOutOctets"
>
> This one tells me:
> Error parsing /etc/telegraf/telegraf.d/bridge.telegraf.conf, line 4: field
> corresponding to `host' is not defined in `*snmp.Snmp'
>
> I've tried using include_instances attached to the interface field or to the
> table:
> Error parsing /etc/telegraf/telegraf.d/bridge.telegraf.conf, line 21: field
> corresponding to `include_instances' is not defined in `*snmp.Field'
> Error parsing /etc/telegraf/telegraf.d/bridge.telegraf.conf, line 16: field
> corresponding to `include_instances' is not defined in `*snmp.Table'
>
> I've been following these articles among others:
> https://www.dev-eth0.de/blog/2016/12/06/grafana_snmp.htmlhttp://installfights.blogspot.com.au/2016/10/snmp-telegraf-influxdb.htmlhttps://github.com/influxdata/telegraf/blob/master/plugins/inputs/snmp/README.mdhttps://github.com/influxdata/telegraf/blob/master/plugins/inputs/snmp/CONFIG-EXAMPLES.mdIt
> seems silly to only support configurations where every counter is stored for
> every port (a 48 port switch where you only want to monitor 2 counters on 2
> ports might be producing 240x the data, 99.9% of which is rubbish). Would I
> be right in guessing this is what subtables are for? What's the syntax for
> them (I can't find any documentation suitable for a muppet like me).
>
> In case it's important, I'm on Telegraf v1.2.0 (git: release-1.2
> b2c1d98cff5a58d5ded3e74741c6bc32d6e789ee)
I'm not sure what documentation you're looking at, but your configuration is
rather off. For example the errors your'e getting are because there are no
configuration options `[[inputs.snmp.host]]` or `include_instances`.
The following should work:
[[inputs.snmp]]
interval = "30s"
agents = ["W.X.Y.Z:161"]
version = 2
community = "MyCommunity"
[[inputs.snmp.field]]
name = "hostname"
oid = "RFC1213-MIB::sysName.0"
is_tag = true
[[inputs.snmp.table]]
name = "snmp"
inherit_tags = [ "hostname" ]
[[inputs.snmp.table.field]]
name = "interface"
oid = "IF-MIB::ifName"
is_tag = true
[[inputs.snmp.table.field]]
name = "bytesIn"
oid = "IF-MIB::ifHCInOctets"
[[inputs.snmp.table.field]]
name = "bytesOut"
oid = "IF-MIB::ifHCOutOctets"
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit
https://groups.google.com/d/msgid/influxdb/a7cfd7c1-9bdd-4770-a23f-d51bb1892161%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.