On Sunday, February 19, 2017 at 7:38:11 PM UTC-6, [email protected] wrote: > On Tuesday, February 14, 2017 at 5:31:32 PM UTC-5, Daniel Rich wrote: > > I am trying to collect data from a Cisco switch where some of the data is > > in IF-MIB::ifTable and some in IF-MIB::ifXTable but both share the same > > index. Is there a way to relate these tables with the new snmp plugin in > > the same way that it looks like mapping_table did in the old one? > > > > > > Here is my current current configuration: > > > > > > > > [[inputs.snmp.table]] > > name = "ifXTable" > > inherit_tags = [ "hostname" ] > > oid = "IF-MIB::ifXTable" > > > > [[inputs.snmp.table.field]] > > name = "ifName" > > oid = "IF-MIB::ifName" > > is_tag = true > > > > [[inputs.snmp.table.field]] > > name = "ifAlias" > > oid = "IF-MIB::ifAlias" > > is_tag = true > > > > [[inputs.snmp.table]] > > name = "ifTable" > > inherit_tags = [ "hostname" ] > > oid = "IF-MIB::ifTable" > > > > [[inputs.snmp.table.field]] > > name = "ifDescr" > > oid = "IF-MIB::ifDescr" > > is_tag = true > > > > > > > > The problem is that I cannot use the same keys to index into both tables in > > grafana. If I want to graph the in/out bits on an interface using the > > ifAlias value, I can do something like: > > > > > > SELECT derivative(mean("ifHCInOctets"), 1s) * 8 AS "Out", > > derivative(mean("ifHCOutOctets"), 1s) * -8 AS "In" FROM "snmp" WHERE > > "hostname" = 'myswitch.example.com' AND "ifAlias" = 'MyComputer' AND > > $timeFilter GROUP BY time($interval) fill(null) > > > > > > But, if I then want to graph the in/out discards, the following won't work: > > > > > > SELECT derivative(mean("ifInDiscards"), 1s) AS "In Discards", > > derivative(mean("ifOutDiscards"), 1s) * -1 AS "Out Discards" FROM "snmp" > > WHERE "hostname" = 'myswitch.example.com' AND "ifAlias" = 'MyComputer' AND > > $timeFilter GROUP BY time($interval) fill(0) > > > > > > While the indexes are the same between the tables, the doesn't seem to be > > any other piece of information that would let me relate them (and I'm not > > sure how I would use it in grafana even if their was). Here's an example of > > the snmpwalk for one of the interfaces: > > > > > > > > > snmpwalk -v2c -c xxxxxx myswitch IF-MIB::ifTable | grep 10638 > > IF-MIB::ifIndex.10638 = INTEGER: 10638 > > IF-MIB::ifDescr.10638 = STRING: GigabitEthernet2/0/38 > > IF-MIB::ifType.10638 = INTEGER: ethernetCsmacd(6) > > IF-MIB::ifMtu.10638 = INTEGER: 1500 > > IF-MIB::ifSpeed.10638 = Gauge32: 100000000 > > IF-MIB::ifPhysAddress.10638 = STRING: 01:23:45:67:89:ab > > IF-MIB::ifAdminStatus.10638 = INTEGER: up(1) > > IF-MIB::ifOperStatus.10638 = INTEGER: up(1) > > IF-MIB::ifLastChange.10638 = Timeticks: (27226) 0:04:32.26 > > IF-MIB::ifInOctets.10638 = Counter32: 1162648269 > > IF-MIB::ifInUcastPkts.10638 = Counter32: 19443131 > > IF-MIB::ifInDiscards.10638 = Counter32: 0 > > IF-MIB::ifInErrors.10638 = Counter32: 1 > > IF-MIB::ifInUnknownProtos.10638 = Counter32: 0 > > IF-MIB::ifOutOctets.10638 = Counter32: 712482063 > > IF-MIB::ifOutUcastPkts.10638 = Counter32: 29374244 > > IF-MIB::ifOutDiscards.10638 = Counter32: 0 > > IF-MIB::ifOutErrors.10638 = Counter32: 0 > > > > > > > snmpwalk -v2c -c xxxxxx myswitch IF-MIB::ifXTable | grep 10638 > > IF-MIB::ifName.10638 = STRING: Gi2/0/38 > > IF-MIB::ifInMulticastPkts.10638 = Counter32: 791 > > IF-MIB::ifInBroadcastPkts.10638 = Counter32: 809 > > IF-MIB::ifOutMulticastPkts.10638 = Counter32: 3189389 > > IF-MIB::ifOutBroadcastPkts.10638 = Counter32: 172303 > > IF-MIB::ifHCInOctets.10638 = Counter64: 26933585693 > > IF-MIB::ifHCInUcastPkts.10638 = Counter64: 19443926 > > IF-MIB::ifHCInMulticastPkts.10638 = Counter64: 791 > > IF-MIB::ifHCInBroadcastPkts.10638 = Counter64: 809 > > IF-MIB::ifHCOutOctets.10638 = Counter64: 13597535403 > > IF-MIB::ifHCOutUcastPkts.10638 = Counter64: 29374824 > > IF-MIB::ifHCOutMulticastPkts.10638 = Counter64: 3189400 > > IF-MIB::ifHCOutBroadcastPkts.10638 = Counter64: 172303 > > IF-MIB::ifLinkUpDownTrapEnable.10638 = INTEGER: enabled(1) > > IF-MIB::ifHighSpeed.10638 = Gauge32: 100 > > IF-MIB::ifPromiscuousMode.10638 = INTEGER: false(2) > > IF-MIB::ifConnectorPresent.10638 = INTEGER: true(1) > > IF-MIB::ifAlias.10638 = STRING: MyComputer > > IF-MIB::ifCounterDiscontinuityTime.10638 = Timeticks: (0) 0:00:00.00 > > Yes, you have to just define a single table in the config. > > For example: > > [[inputs.snmp.table]] > name = "ifXTable" > inherit_tags = [ "hostname" ] > oid = "IF-MIB::ifXTable" > > [[inputs.snmp.table.field]] > name = "ifName" > oid = "IF-MIB::ifName" > is_tag = true > > [[inputs.snmp.table.field]] > name = "ifAlias" > oid = "IF-MIB::ifAlias" > is_tag = true > > [[inputs.snmp.table.field]] > name = "ifDescr" > oid = "IF-MIB::ifDescr" > is_tag = true > > > The downside to this is that on the second table, that you want to join into > the first one, you have to specify all the fields you want. There is no > automatic field generation here. > We might be able to introduce some way of doing this, such as passing an > array to the table `oid` parameter, but I'm not sure how hairy it'd be, and > whether it would be justified.
I'd say its quite justified. A good deal of snmp is predefined and deterministic therefore dynamically generating tables shouldn't be an issue. Heck a single walk on a mib would give one the majority of what they need to populate a table. If Telegraf is to be taken seriously among enterprise shops then its going to need to actually support more than just a few servers while being way easier to deploy than making a phone call. -- 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/01e126bc-ace1-41bf-a1aa-c331eb266e73%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
