Group Property Reader

Group Property Readers are used to read out components of a device with multiple, related values. They are mostly used for reading out components that exist multiple times within a device (e.g. interfaces).

Like a property reader, a group property reader always has a detection type. This type defines how the values are read out. Currently, Thola only supports one detection type: snmpwalk. This detection type reads out values through snmpwalks and maps these values to groups based on the indices of the snmp responses.

The base structure of a group property reader looks like this:

Parameters Description
detection Describes how to retrieve the value
values Key + Value list of values which will be read out

The structure of an element of the values list depends on the detection type of the group property reader. For snmpwalk, these elements have the following structure:

Parameters Description
oid OID which will be walked to retrieve values
operators array of operators to normalize a value, optionally
indices_mapping map indices of snmpwalk result to another snmpwalk, optionally

The oid parameter is a string that contains the OID which will be walked. operators can be added optionally to normalize or filter values returned by the snmpwalk.

The following example shows the group property reader for reading out network interfaces:

  detection: snmpwalk
  values:
    ifIndex:
      oid: 1.3.6.1.2.1.2.2.1.1
    ifDescr:
      oid: 1.3.6.1.2.1.2.2.1.2
    ifType:
      oid: 1.3.6.1.2.1.2.2.1.3
      operators:
        - type: modify
          modify_method: map
          mappings: ifType.yaml
    ifSpeed:
      oid: 1.3.6.1.2.1.2.2.1.5
    ifAdminStatus:
      oid: 1.3.6.1.2.1.2.2.1.7
      operators:
        - type: modify
          modify_method: map
          ignore_on_mismatch: true
          mappings:
            "1": "up"
            "2": "down"
            "3": "testing"
    ...

Usually the results of all single snmpwalks are put together in groups based on the last index of the oid which was returned during the snmpwalk. indices_mapping allows changing this index by assigning it to another snmpwalk result. This is necessary when you want to group a result of an snmpwalk together with other values that are not part of the same snmp table, but a conversion oid for these snmp tables exists.

The indices_mapping is used in the following example for reading out CRC align errors of network interfaces. These errors are in a different snmp table and not indexed by the ifIndex of an interface, but there is a conversion table which maps these special indices to an ifIndex:

etherStatsCRCAlignErrors:
  oid: 1.3.6.1.2.1.16.1.1.1.8
  indices_mapping:
    oid: 1.3.6.1.2.1.16.1.1.1.2
    operators:
      - type: modify
        modify_method: regexSubmatch
        regex: '\.?([0-9]+)$'
        format: "$1"

Within a group property reader, values can again be grouped under a key inside of the values map. This is a special case in which a value does not consist of an oid and optionally operators and an indices mapping. Instead, a value simple contains one parameter called values, which again is a list of multiple values. All values which are grouped under the same key will be grouped in the result Thola returns aswell. This is mostly used when reading out information of a group that belongs together, for instance information about a special interface type.

This example shows a part of a group property reader for reading out interfaces. Some values which only exist for radio interfaces are grouped together under the value “radio”:

ifIndex:
  oid: 1.3.6.1.2.1.2.2.1.1
ifDescr:
  oid: 1.3.6.1.2.1.2.2.1.2
radio:
  values:
    level_in:
      oid: 1.3.6.1.4.1.2281.10.5.1.1.2
    level_out:
      oid: 1.3.6.1.4.1.2281.10.5.1.1.3