Telegraf , SNMP Tag keys issue

Hey Hi ,

I’m using oid to get the snmp fields and when i set is_tag = true , the data is missing and the configuration is below

when i remove is_tag = true data is being pushed to the influx db , as without tags i was unable to perform influx db time series analysis

[[inputs.snmp]]
agents = [ “103.148.119.222” ]
version = 2
community = “private”
interval = “5s”
timeout = “10s”
retries = 3
[[inputs.snmp.field]]
oid = “SNMPv2-MIB::sysDescr.0”
name = “hostname”

[[inputs.snmp.table]]
name = “onu”
inherit_tags = [“hostname”]
[[inputs.snmp.table.field]]
name = “rx”
oid = “1.3.6.1.4.1.37950.1.1.6.1.1.3.1.7”
[[inputs.snmp.table.field]]
name = “ONUname”
oid = “1.3.6.1.2.1.31.1.1.1.1”
is_tag = true

Welcome!
Can you clarify what your desired result is? Is it working without tagging ? If not, what about it is isn’t working?

The general rule of thumb is do not creat a tag unless you actually need it. Creating extra tags increases series cardinality ,

Goal : To capture multiple interfaces RX Transmission Power

OID 1 : Interface name
OID 2 : RX Transmission power

where currently i’m able to capture these values and push them to influx metrics , but when i try to put analytics in Grafana the interface was not getting listed in SELECT

> select * from interface limit 10
name: interface
time                agent_host      host       hostname ifDescr                        rx
----                ----------      ----       -------- -------                        --
1622968194000000000 100.164.119.222 TESTIN-NMS V1600G0  GPON03ONU31 jayantilal-bsnl    -14.498(dBm)
1622968199000000000 100.164.119.222 TESTIN-NMS V1600G0  GPON01ONU4 abbastara           -13.686(dBm)
1622968203000000000 100.164.119.222 TESTIN-NMS V1600G0  GPON03ONU26                    -17.906(dBm)
1622968210000000000 100.164.119.222 TESTIN-NMS V1600G0  GPON02ONU9 ashishthakur        -16.218(dBm)
1622968215000000000 103.148.119.222 TESTIN-NMS V1600G0  GPON02ONU15 YASHWANTMEENA-BSNL -19.548(dBm)

When i tried to make the OID 1 as is_tag = true the data is null , but without tag the data is being pushed

Thanks for replying , awaiting to see how can this be fixed

Your table is called onu instead of interface.

What do you get as output when running telegraf --test?

HI Hipska ,

i just renamed my table from onu to interface

1 Like

Hi everyone, could you help me? i try graphing value of onu power rx, I am doing something wrong.

>  SELECT * FROM "Snmp_Onus" taks
ERR: error parsing query: found taks, expected ; at line 1, char 27
>  SELECT * FROM "Snmp_Onus" 
name: Snmp_Onus
time                OnuIndex Onurx        agent_host gOnuOpticalInfoBias gOnuOpticalInfoOnuInx gOnuOpticalInfoPonInx gOnuOpticalInfoRxPwr gOnuOpticalInfoTemp gOnuOpticalInfoTxPwr gOnuOpticalInfoVolt host
----                -------- -----        ---------- ------------------- --------------------- --------------------- -------------------- ------------------- -------------------- ------------------- ----
1663947681000000000 1        -21.080(dBm) 10.20.41.2 14.800(mA)          1                     1                     -21.192(dBm)         33.750(C)           2.374(dBm)           3.42(V)             9de4157992ae
1663947681000000000 10       -19.172(dBm) 10.20.41.2 12.600(mA)          10                    1                     -19.202(dBm)         24.309(C)           1.950(dBm)           3.36(V)             9de4157992ae
1663947681000000000 11       -20.080(dBm) 10.20.41.2 12.250(mA)          11                    1                     -20.000(dBm)         28.152(C)           1.888(dBm)           3.40(V)             9de4157992ae
1663947681000000000 12       -19.102(dBm) 10.20.41.2 11.200(mA)          12                    1                     -19.202(dBm)         27.453(C)           1.988(dBm)           3.40(V)             9de4157992ae
1663947681000000000 13       -18.666(dBm) 10.20.41.2 11.700(mA)          13                    1                     -18.730(dBm)         36.199(C)           2.044(dBm)           3.32(V)             9de4157992ae
1663947681000000000 14       -22.840(dBm) 10.20.41.2 14.750(mA)          14                    1                     -22.926(dBm)         33.402(C)           2.470(dBm)           3.36(V)             9de4157992ae

[[inputs.snmp]]
** agents = [ “10.20.41.2:161” ] # Replace this with your router(s) IP/port**
** community = “ad123”**
** interval = “60s”**
** name = “an1”**
** #OLT**
** [[inputs.snmp.table]]**
** name = “Snmp_Onus”**
** oid = “V1600G::gOnuOpticalInfoTable”**
[[inputs.snmp.table.field]]
name = “OnuIndex”
oid = “1.3.6.1.4.1.37950.1.1.6.1.1.3.1.2”
is_tag = true

[[inputs.snmp.table.field]]
name = “Onurx”
oid = “1.3.6.1.4.1.37950.1.1.6.1.1.3.1.7”
is_tag = true