Daniel Rich
2017-02-14 22:31:32 UTC
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
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
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
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
snmpwalk -v2c -c xxxxxx myswitch IF-MIB::ifTable | grep 10638
IF-MIB::ifIndex.10638 = INTEGER: 10638IF-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/38IF-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
--
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 influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/5bfd4092-7621-4d49-b0df-b17eb986acf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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 influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
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/5bfd4092-7621-4d49-b0df-b17eb986acf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.