Getting(Collecting) optical rx/tx from router using telegraf

I’m trying to get optical rx/tx dB from router using telegraf and influxdb.
For this, I’m using oid ‘.1.3.6.1.4.1.9.9.91.1.1.1.1.4’.
and I can get like this by ‘snmpwalk’. (my OS is centos7)


snmpwalk -v2c -c .1.3.6.1.4.1.9.9.91.1.1.1.1.4

SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38550 = INTEGER: 40
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38551 = INTEGER: 48
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38552 = INTEGER: 53
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38553 = INTEGER: 48
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38554 = INTEGER: 48
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39830 = INTEGER: 28
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39831 = INTEGER: 35
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39894 = INTEGER: 25
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39895 = INTEGER: 35
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39958 = INTEGER: 28
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.39959 = INTEGER: 33
(…)
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.300959203 = INTEGER: 3286
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.300959204 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.300959207 = INTEGER: 17332
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.300959213 = INTEGER: -2403
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.300959214 = INTEGER: 0
(…)

I think that there are rx/tx value…

I want to collect these all values in influxdb databases or just two values(rx and tx dB).

But, I can’t do well now…
It’s my telegraf.conf file

[[inputs.snmp.table]]
name = “interface1”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “con1”
oid = “.1.3.6.1.4.1.9.9.91.1.1.1.1.4”

using that conf file, I could get this database.(the name ‘router15’, ‘con1’ have no mean.)


use router15
Using database router15
show measurements
name: measurements
name
interface1
select * from interface1 limit 10
name: interface1
time agent_host con1 host
1579666730000000000 ip 43 localhost.localdomain
1579666740000000000 ip -3010 localhost.localdomain
1579666750000000000 ip 24632 localhost.localdomain
1579666760000000000 ip 0 localhost.localdomain
1579666770000000000 ip 42 localhost.localdomain
1579666780000000000 ip 3287 localhost.localdomain
1579666790000000000 ip -3010 localhost.localdomain
1579666800000000000 ip 30932 localhost.localdomain
1579666810000000000 ip 7494 localhost.localdomain
1579666820000000000 ip 0 localhost.localdomain

the value(con1) is strange… something wrong…all values is stored randomly.
(collect interval time is 10s)

below string(using index) is working well in ‘snmpwalk’ command.

snmpwalk -v2c -c .1.3.6.1.4.1.9.9.91.1.1.1.1.4.38550
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.38550 = INTEGER: 42

but, when I inserted that string into ‘telegraf.conf’ and tested, the result is like that…

[[inputs.snmp.table]]
name = “interface1”
inherit_tags = [ “hostname” ]
[[inputs.snmp.table.field]]
name = “con1”
oid = “.1.3.6.1.4.1.9.9.91.1.1.1.1.4.38550” #added


telegraf --test --config telegraf.conf --debug

2020-01-22T05:03:21Z I! Starting Telegraf 1.13.1
2020-01-22T05:03:21Z D! [agent] Initializing plugins
2020-01-22T05:03:21Z D! [inputs.snmp] executing “snmptranslate” “-Td” “-Ob” “-m” “all” “.1.3.6.1.4.1.9.9.91.1.1.1.1.4.38550”

and database is created but anything is saved in database.

How can I store all or specific values?
Is [[inputs.snmp.table]] section wrong?