[SOLVED] Help with yaml discovery

Tags: #<Tag:0x00007f3b7e602d98> #<Tag:0x00007f3b7e602c58>

Hi to all
i am confused with new YAML discovery, so i like to ask for help

i have a Eltex MES2308R switch, LibreNMS is discovering VLAN’s, this part is OK
but nothing else
I am really miss SFP readouts (voltage,tx/rx power, temperature etc)
ok, after googling, it is look like there is RADLAN compatibility

so, for now, i wrote this in YAML

mib: RADLAN-PHY-MIB:RADLAN-rndMng
modules:
    os:
        version: .1.3.6.1.2.1.47.1.1.1.1.10.67108992
        hardware: .1.3.6.1.2.1.47.1.1.1.1.13.67108992
        serial: .1.3.6.1.2.1.47.1.1.1.1.11.67108992
    processors:
        data:
            -
                oid: rlCpuUtilDuringLast5Minutes
                num_oid: '.1.3.6.1.4.1.89.1.9.{{ $index }}'

this is working for now, but i need SFP info

so, the OID is .1.3.6.1.4.1.89.90.1.2.1.3. INDEX, TYPE
where
INDEX=ifIndex
TYPE:
rlPhyTestTableTransceiverTemp (5)
rlPhyTestTableTransceiverSupply (6)
rlPhyTestTableTxBias (7)
rlPhyTestTableTxOutput (8)
rlPhyTestTableRxOpticalPower (9)

i would like to ask for help because i have no enough knowledge to write

sensors:
    voltage:
        data:

and other section in YAML

please, help

iso.3.6.1.4.1.89.90.1.2.1.3.58.5 = INTEGER: 43
iso.3.6.1.4.1.89.90.1.2.1.3.58.6 = INTEGER: 3338400
iso.3.6.1.4.1.89.90.1.2.1.3.58.7 = INTEGER: 11075
iso.3.6.1.4.1.89.90.1.2.1.3.58.8 = INTEGER: -6095
iso.3.6.1.4.1.89.90.1.2.1.3.58.9 = INTEGER: -7116

Hi, maybe you can snmp walkthrough by using mib browser and your device to check the accurate info details on the sensors.

You must check the correct OID for the device in order to get the sensors to get read.
As picture above, I am using MIB browser with MIB files specific for the device. From there you can know which MIBs file are using.

For the yaml discovery, you may check other os example.

File location /opt/librenms/includes/definitions/discovery/fiberhome-switch.yaml

Hope it works for you.

Hi @keryazmi

so if i get it correctly, there is no way to discover device in YAML without propper MIB’s?

And another question

in other YAML’s there is always $index at the end of “num_oid”
X . X . X . X .{{ $index }}

in my example, it need to be ?
‘.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}.5’ // for temperature
‘.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}.6’ // for voltage

did i get it right ?

lack of documentation is killing me :frowning:

And another question:
did i understand correctly, that
oid: NameOfOid // this is for discovery ?
num_oid: x.x.x.x.x.x.x // this is for polling ??

Hi @Peca_Nesovanovic,

Better use MIB to discover device to get accurate OID use.

$index is use for recurring OID for example port 1 will be x.x.x.1 and port 2 will be x.x.x.2 and so on and it will return a value. Compare each OID with recurring and replace it with $index.

Supposely, ‘.1.3.6.1.4.1.89.90.1.2.1.3.58. {{ $index }}’

OID works as tree and subtree.
oid : tree (eg. sfpDiagnosticTable) refer picture as previous.
num_oid : subtree (eg. OID)

That’s why we need MIB files to explore what data we need to capture.

Hi @keryazmi

thank you for your time

as i suspected, the OID’s are for RADLAN

so i tried in YAML
sensors:
pre-cache:
data:
-
oid:
- rlPhyTestGetResult

and get this:

rlPhyTestGetResult.54.rlPhyTestTableCableLength = 3
rlPhyTestGetResult.54.rlPhyTestTableCableChannel1 = 1
rlPhyTestGetResult.54.rlPhyTestTableCableChannel2 = 1
rlPhyTestGetResult.54.rlPhyTestTableCableChannel3 = 1
rlPhyTestGetResult.54.rlPhyTestTableCableChannel4 = 1
rlPhyTestGetResult.54.rlPhyTestTableCablePolarity1 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePolarity2 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePolarity3 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePolarity4 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePairSkew1 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePairSkew2 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePairSkew3 = 0
rlPhyTestGetResult.54.rlPhyTestTableCablePairSkew4 = 0
rlPhyTestGetResult.55.rlPhyTestTableCableLength = 10
rlPhyTestGetResult.55.rlPhyTestTableCableChannel1 = 1
rlPhyTestGetResult.55.rlPhyTestTableCableChannel2 = 1
rlPhyTestGetResult.55.rlPhyTestTableCableChannel3 = 1
rlPhyTestGetResult.55.rlPhyTestTableCableChannel4 = 1
rlPhyTestGetResult.55.rlPhyTestTableCablePolarity1 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePolarity2 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePolarity3 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePolarity4 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePairSkew1 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePairSkew2 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePairSkew3 = 0
rlPhyTestGetResult.55.rlPhyTestTableCablePairSkew4 = 0
rlPhyTestGetResult.56.rlPhyTestTableCableLength = 36
rlPhyTestGetResult.56.rlPhyTestTableCableChannel1 = 1
rlPhyTestGetResult.56.rlPhyTestTableCableChannel2 = 1
rlPhyTestGetResult.56.rlPhyTestTableCableChannel3 = 1
rlPhyTestGetResult.56.rlPhyTestTableCableChannel4 = 1
rlPhyTestGetResult.56.rlPhyTestTableCablePolarity1 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePolarity2 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePolarity3 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePolarity4 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePairSkew1 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePairSkew2 = 8
rlPhyTestGetResult.56.rlPhyTestTableCablePairSkew3 = 0
rlPhyTestGetResult.56.rlPhyTestTableCablePairSkew4 = 0
rlPhyTestGetResult.57.rlPhyTestTableCableLength = 51
rlPhyTestGetResult.57.rlPhyTestTableCableChannel1 = 0
rlPhyTestGetResult.57.rlPhyTestTableCableChannel2 = 0
rlPhyTestGetResult.57.rlPhyTestTableCableChannel3 = 0
rlPhyTestGetResult.57.rlPhyTestTableCableChannel4 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePolarity1 = 1
rlPhyTestGetResult.57.rlPhyTestTableCablePolarity2 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePolarity3 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePolarity4 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePairSkew1 = 8
rlPhyTestGetResult.57.rlPhyTestTableCablePairSkew2 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePairSkew3 = 0
rlPhyTestGetResult.57.rlPhyTestTableCablePairSkew4 = 0
rlPhyTestGetResult.58.rlPhyTestTableTransceiverTemp = 43
rlPhyTestGetResult.58.rlPhyTestTableTransceiverSupply = 3338400
rlPhyTestGetResult.58.rlPhyTestTableTxBias = 11150
rlPhyTestGetResult.58.rlPhyTestTableTxOutput = -6068
rlPhyTestGetResult.58.rlPhyTestTableRxOpticalPower = -7129
rlPhyTestGetResult.58.rlPhyTestTableDataReady = 1
rlPhyTestGetResult.58.rlPhyTestTableLOS = 0
rlPhyTestGetResult.58.rlPhyTestTableTxFault = 0
rlPhyTestGetResult.58.26 = 2
rlPhyTestGetResult.58.27 = -7116
rlPhyTestGetResult.58.28 = -7116
rlPhyTestGetResult.58.29 = -7116
rlPhyTestGetResult.58.30 = 11125
rlPhyTestGetResult.58.31 = 11150
rlPhyTestGetResult.58.32 = 11125
rlPhyTestGetResult.58.33 = 0
rlPhyTestGetResult.58.34 = 0
rlPhyTestGetResult.58.35 = 0  

now i need help to assemble YAML
if you have some more time …

tnx

Please share MIB files here. We’ll look into this.

Hi @keryazmi

MIB’s are from LibreNMS distro

/opt/librenms/mibs/radlan
and the “RADLAN-PHY-MIB” is one that describe this OID

so, i tried this:

        voltage:
            options:
                skip_values: 0
            data:
                -
                    snmp_flags: ['-ObsQ']
                    oid: rlPhyTestGetResult
                    num_oid: '.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}'
                    value: rlPhyTestTableTransceiverSupply
                    descr: 'SfpVoltage.{{ $index }}'
                    index: 'rlPhyTestTableTransceiverSupply.{{ $index }}'

and it’s not working

Voltage: 
Dynamic Discovery (voltage):  

array (
  'options' => 
  array (
    'skip_values' => 0,
  ),
  'data' => 
  array (
    0 => 
    array (
      'snmp_flags' => 
      array (
        0 => '-ObsQ',
      ),
      'oid' => 'rlPhyTestGetResult',
      'num_oid' => '.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}',
      'value' => 'rlPhyTestTableTransceiverSupply',
      'descr' => 'SfpVoltage.{{ $index }}',
      'index' => 'rlPhyTestTableTransceiverSupply.{{ $index }}',
    ),
  ),
)  

Data rlPhyTestGetResult:  

array (
  '54.rlPhyTestTableCableLength' => 
  array (
    'rlPhyTestGetResult' => '3',
  ),
  '54.rlPhyTestTableCableChannel1' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '54.rlPhyTestTableCableChannel2' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '54.rlPhyTestTableCableChannel3' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '54.rlPhyTestTableCableChannel4' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '54.rlPhyTestTableCablePolarity1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePolarity2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePolarity3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePolarity4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePairSkew1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePairSkew2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePairSkew3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '54.rlPhyTestTableCablePairSkew4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCableLength' => 
  array (
    'rlPhyTestGetResult' => '10',
  ),
  '55.rlPhyTestTableCableChannel1' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '55.rlPhyTestTableCableChannel2' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '55.rlPhyTestTableCableChannel3' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '55.rlPhyTestTableCableChannel4' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '55.rlPhyTestTableCablePolarity1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePolarity2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePolarity3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePolarity4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePairSkew1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePairSkew2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePairSkew3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '55.rlPhyTestTableCablePairSkew4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCableLength' => 
  array (
    'rlPhyTestGetResult' => '37',
  ),
  '56.rlPhyTestTableCableChannel1' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '56.rlPhyTestTableCableChannel2' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '56.rlPhyTestTableCableChannel3' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '56.rlPhyTestTableCableChannel4' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '56.rlPhyTestTableCablePolarity1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePolarity2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePolarity3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePolarity4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePairSkew1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePairSkew2' => 
  array (
    'rlPhyTestGetResult' => '8',
  ),
  '56.rlPhyTestTableCablePairSkew3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '56.rlPhyTestTableCablePairSkew4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCableLength' => 
  array (
    'rlPhyTestGetResult' => '52',
  ),
  '57.rlPhyTestTableCableChannel1' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCableChannel2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCableChannel3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCableChannel4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePolarity1' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '57.rlPhyTestTableCablePolarity2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePolarity3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePolarity4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePairSkew1' => 
  array (
    'rlPhyTestGetResult' => '8',
  ),
  '57.rlPhyTestTableCablePairSkew2' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePairSkew3' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '57.rlPhyTestTableCablePairSkew4' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '58.rlPhyTestTableTransceiverTemp' => 
  array (
    'rlPhyTestGetResult' => '43',
  ),
  '58.rlPhyTestTableTransceiverSupply' => 
  array (
    'rlPhyTestGetResult' => '3338400',
  ),
  '58.rlPhyTestTableTxBias' => 
  array (
    'rlPhyTestGetResult' => '11025',
  ),
  '58.rlPhyTestTableTxOutput' => 
  array (
    'rlPhyTestGetResult' => '-6095',
  ),
  '58.rlPhyTestTableRxOpticalPower' => 
  array (
    'rlPhyTestGetResult' => '-7129',
  ),
  '58.rlPhyTestTableDataReady' => 
  array (
    'rlPhyTestGetResult' => '1',
  ),
  '58.rlPhyTestTableLOS' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '58.rlPhyTestTableTxFault' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '58.26' => 
  array (
    'rlPhyTestGetResult' => '2',
  ),
  '58.27' => 
  array (
    'rlPhyTestGetResult' => '-7129',
  ),
  '58.28' => 
  array (
    'rlPhyTestGetResult' => '-7129',
  ),
  '58.29' => 
  array (
    'rlPhyTestGetResult' => '-7129',
  ),
  '58.30' => 
  array (
    'rlPhyTestGetResult' => '11075',
  ),
  '58.31' => 
  array (
    'rlPhyTestGetResult' => '11075',
  ),
  '58.32' => 
  array (
    'rlPhyTestGetResult' => '11075',
  ),
  '58.33' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '58.34' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
  '58.35' => 
  array (
    'rlPhyTestGetResult' => '0',
  ),
)  

Final sensor value:  

Final sensor value:  
Final sensor value:  

Final sensor value:  
Final sensor value:  

Final sensor value:  
Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Final sensor value:  

Hi @Peca_Nesovanovic,
I am not sure this can be done in YAML. This mib is not ending with the index, and this is more or less mandatory for YAML discovery and polling. You’ll have to do it the “PHP” way (or be ready to dig in the YAML discovery code to check if yes or no this MIB is discoverable and pollable with current code)

Hi @PipoCanaja
tnx for reply

As you wrote: This mib is not ending with the index

So i was right

in my example, it need to be ?
‘.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}.5’ // for temperature
‘.1.3.6.1.4.1.89.90.1.2.1.3.{{ $index }}.6’ // for voltage

Ok, then standalone PHP discovery …
i don’t want to mess with YAML discovery code modifications because updates will overwtite it

Already done the storage discovery/polling for this device and it is working

tnx again

Solved
standalone PHP sensor discovery was solution
@PipoCanaja
@keryazmi
tnx for support