Sensors

This document will guide you through adding health / sensor information for your new device.

Currently we have support for the following health metrics along with the values we expect to see the data in:

Class Measurement
airflow cfm
charge %
cooling W
current A
dbm dBm
fanspeed rpm
frequency Hz
humidity %
load %
power W
pressure kPa
runtime Min
signal dBm
snr SNR
state #
temperature C
voltage V

Simple health discovery

We have support for defining health / sensor discovery using YAML files so that you don't need to know how to write PHP.

Please note that DISPLAY-HINTS are disabled so ensure you use the correct divisor / multiplier if applicable.

All yaml files are located in includes/definitions/discovery/$os.yaml. Defining the information hear is not always possible and is heavily reliant on vendors being sensible with the MIBs they generate. Only snmp walks are supported and you must provide a sane table that can be traversed and contains all of the data you need. We will use netbotz as an example here.

includes/definitions/discovery/netbotz.yaml

mib: NETBOTZV2-MIB
modules:
    sensors:
        airflow:
            options:
                skip_values_lt: 0
            data:
                -
                    oid: airFlowSensorTable
                    value: airFlowSensorValue
                    divisor: 10
                    num_oid: .1.3.6.1.4.1.5528.100.4.1.5.1.2.
                    descr: airFlowSensorLabel
                    index: 'airFlowSensorValue.{{ $index }}'

At the top you can define one or more mibs to be used in the lookup of data:

mib: NETBOTZV2-MIB

For data: you have the following options:

The only sensor we have defined here is airflow. The available options are as follows:

For options: you have the following available:

If you aren't able to use yaml to perform the sensor discovery, you will most likely need to use Advanced health discovery.

Advanced health discovery

If you can't use the yaml files as above, then you will need to create the discovery code in php.

The directory structure for sensor information is includes/discovery/sensors/$class/$os.inc.php. The format of all of the sensors follows the same code format which is to call the discover_sensor() function - with the exception of state which requires additional code.

discover_sensor() Accepts the following arguments:

For the majority of devices, this is all that's required to add support for a sensor. Polling is done based on the data gathered using discover_sensor(). If custom polling is needed then the file format is similar to discovery: includes/polling/sensors/$class/$os.inc.php. Whilst it's possible to perform additional snmp queries within polling this should be avoided where possible. The value for the OID is already available as $sensor_value.

Graphing is performed automatically for sensors, no custom graphing is required or supported.