match

The “match” section is used to check whether a device belongs to a specific device class or not. Therefore it uses conditions that need to be declared under this section.

Conditions can look like the following:

logical_operator: OR
conditions:
- match_mode: startsWith
  type: SysObjectID
  values:
    - .1.3.6.1.4.1.12148.10
- type: snmpget
  oid: .1.3.6.1.4.1.12148.10.2.6.0
  match_mode: regex
  values:
    - '(Micropack System|Smartpack S|SmartPack2 Touch)(\s*)?$'

The “logical_operator” keyword can be used to combine multpile conditions, the possible values are “OR” and “AND”. The conditions that are chained by the logial operator should be contained in the “conditions” keyword. It can also be used to create more complex conditions by recursively chaining these logical operator constructs.

The “conditions” keyword contains the condition(s) that need to hold true for a device to be counted to the device class. There are four types of conditions that can be declared under the keyword “type”:

   Type           : needed parameters
-------------------------------------------
1. SysDescription : match_mode, values
2. SysObjectID    : match_mode, values
3. snmpget        : match_mode, values, oid 
4. HTTPGetBody    : match_mode, values, path

The “match_mode” keyword describes what kind of comparison is done in the condition. There are four different possible values that compare the value from the keyword “values” (String A) and the devices property for the value stored in “type” (String B):

   Value    : Description
----------------------------------------------------------------------------
1. contains : String B needs to contain String A as a substring
2. equals   : String B must be equal to String A
3. String   : String B must start with String A
4. regex    : String B has to match the regex expression defined in String A