Property Reader
Property readers are used to read out a single value / property from a device and normalize it afterwards. Every property reader can consist of the following parameters:
Parameters | Description |
---|---|
pre_condition | Condition has to hold true to be able to read out data |
detection | Describes how to retrieve the value |
operators | List / array of operators to be used on the value after retrieving it |
The pre_condition
parameter is optional and consists of conditions. If
the parameter is not set, there are no pre-conditions and Thola will try to read out a property with
this property reader.
The detection
value is mandatory and determines how Thola will retrieve the requested property. Depending on which
detection type is used, additonal parameters need to be added to the property reader, so it can read out
the property. For example, when reading out a property with an snmpget request, the oid which will
be requested needs to be defined.
Currently, there are the following detection
types with the following additional parameters:
Detection | Parameters | Description |
---|---|---|
SysDescription | / | Retrieve value from SysDescription. |
SysObjectID | / | Retrieve value from SysObjectID. |
snmpget | Retrieve value with snmpget. | |
constant | Use a constant value. |
The operators
parameter is optional and offers a way to normalize a value after retrieving it from
the device. There are several possible operators, which are defined here.
The following example shows a property reader for reading out the model description of a JunOS device:
detection: SysDescription
operators:
- type: modify
modify_method: regexSubmatch
regex: '^Juniper Networks, Inc\.\s([^,^\s^$\n]+( \[[^\]]+\])?)(,|\s|$|\n)'
format: "$1"
- type: modify
modify_method: toUpperCase