Telegraf and Snmp

Hello,

I am trying to store dbm measures in ONTs from a GPON OLT device through a private mib. It happens that I am not iterrogating OLT interfaces, since the ONTs are not strictly interfaces, but remote devices that OLT queries for the value through an specific object like these:

232: zxGponPonRxOpticalLevel.269550080.1.1 65535
233: zxGponPonRxOpticalLevel.269550080.2.1 65535
248: zxGponPonRxOpticalLevel.269550336.54.1 11088
249: zxGponPonRxOpticalLevel.269550336.55.1 65535

Issue #1 is I would like to store separated dbm readings for each ONT but gouped by GPON interface. Each GPON interface index is, for example, 269550080.1 and 269550080.2, while the ONT index per interface is 269550080.1 and 269550080.2

So I would like to store the GPON interface index in a field and ONT number in a different field together with the value.

How I could do this?

Issue #2 The value is (32)INT. According to the MIB description:

This attribute reports the current measurement of total
optical signal level at 1490 nm. Its value is a 2s complement
integer referred to 1 mW (ie dBm), with 0.002 dB granularity.(2 byte)

I know the dBm in the unit providing 11088 as value is around -7.815dBm (I can not be precise because it fluctuates a bit between readings).

I also know that -7.815dBm is equivalent to 0.1654 mW. So how could I calculate 11088 into 0.1654 then into -7.85

mW into dBm formula is P(dBm) = 10 ⋅ log10( P(mW) / 1mW)

Any idea or suggestion?

Thanks in advance,

Miguel

Hi again,

I can answer myself. I used

[[inputs.snmp.table]]
name = "onu"
oid = "1.3.6.1.4.1.3902.1012.3.50.12.1"
index_as_tag = true

and index_as_tag did the trick, providing this:

onu,index=269550336.54.1,agent_host=172.16.0.182,host=stalker zxGponPonSRInd=1i,zxGponPonPiggybackDBAReporting=1i,zxGponPonSFThreshold=5i,zxGponPonRxOpticalLevel=11112i,zxGponPonPowerFeedVoltage=164i,zxGponPonUpperTemperatureThreshold=32512i,zxGponPonUpperCurrentThreshold=65500i,zxGponPonSDThreshold=9i,zxGponPonAlarmDisableInterval=0i,zxGponPonUpperRxOpticalThreshold=255i,zxGponPonOntResponseTime=0i,zxGponPonTxOpticalLevel=16245i,zxGponPonLowerTxOpticalThreshold=129i,zxGponPonLowerCurrentThreshold=0i,zxGponPonLowerTemperatureThreshold=33024i,zxGponPonTotalTcontNum=7i,zxGponPonGemBlockLen=48i,zxGponPonWholeOnuDBAReporting=2i,zxGponPonAlarmReport=0i,zxGponPonLowerRxOpticalThreshold=255i,zxGponPonTemperature=14339i,dbm=11113i,zxGponPonUpperTxOpticalThreshold=129i,zxGponPonLaserBiasCurrent=5887i,zxGponPonLowerVoltageThreshold=0i,zxGponPonUpperVoltageThreshold=328i 1512236216000000000

Now, I need to do the following things:

  1. Remove every field from the results except index, agent_host and dbm
  2. From index=269550336.54.1 I need to
    2.1) Remove the trailing .1
    2.2) Store 269550336 in a field called interface
    2.2.2) Translate 269550336 into a readable interface name (for example from a txt containing the translation)
    2.3) Store 54 in a field called onu_number
  3. Translate dbm value 11113 into dbm according previous explanation. I think this task has more to be with the representation than with the storing. So is grafana enough open to implement that calculation like a transformation in the query definiton? Like you do in interface speeds with mean() and derivative(1s).

Anyone could help achieving all or part of the above?

Thanks in advance.

To exclude the other fields what you need to do is add field subtables with the OIDs you are interested in, and remove the oid from the table. You can move the interface to a field by adding it to one of the field subtables as well

[[inputs.snmp.table]]
  name = "onu"
  [[inputs.snmp.table.field]]
    name = "interface"
    oid = "1.3.6.1.4.1.3902.1012.3.50.12.1"
  [[inputs.snmp.table.field]]
    oid = "<oid for dbn>"

You won’t be able to do the translations in Telegraf currently, nor in Grafana AFAIK. It should be possible to do this with Kapacitor though.

Hi Daniel,

Thank you very much for the clue.

Using

[[inputs.snmp.table]]
name = "onu"
index_as_tag = true
[[inputs.snmp.table.field]]
oid = “ZXGPON-ONTMGMT-MIB::zxGponPonRxOpticalLevel”

made the trick, and I am getting much faster queries (i have 4k devices now).

1 Like

Hello guys. sorry for off topic, but can you help me, where I can get ZXGPON-ONTMGMT-MIB mib file?

Hi , Firstly we need to get the MIB file and Copy it to /usr/share/snmp/mibs

next go through the MIB file you will find Unique OID for interface , power and so on

use the appropriate one that helps you get these values

Hello, how are you? I’m looking for the same thing as you. Using Telegraf I tried this configuration
[[inputs.snmp.table]]
name = “onu”
oid = “1.3.6.1.4.1.3902.1012.3.50.12.1”
index_as_tag = true
but I get the following error:
[telegraf] Error running agent: could not initialize input inputs.snmp: initializing table onu: getting table columns: Was that a table? ZXXPON-PROTECTION-MIB::zxPON.3.50.12.1: exit status 1