SNMP custom OID (snmp_custom_oid)
Reads any single SNMP object. A numeric value is scaled and reported as a channel; an integer state can be given a name and a health with a value map; a text object is shown in the message and can be required to equal an expected text.
You do not have to look up the object identifier, the unit and the state names by hand: import the device's MIB and pick the object, and the sensor is made with its name, unit, scale and value map filled in.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
value | Value, or the sensor's name | the sensor's unit, or none | none. Set limits on the sensor. Unknown for a text object. |
matches | Text matches | none | Down when 0. Only reported with expected_text. |
Parameters
| Parameter | Default | Meaning |
|---|---|---|
oid | required | The object instance, dotted, for example 1.3.6.1.4.1.2021.10.1.3.1. A leading dot is fine. Give the whole instance, including the .0 of a scalar or the row index of a table cell. |
scale | 1 | The value is multiplied by this (0.1 for tenths). |
offset | 0 | Added after scaling, so the value is raw * scale + offset. With scale: -1 and offset: 100 an idle percentage becomes a busy one; with scale: 0.5556 and offset: -17.78 Fahrenheit becomes Celsius. |
unit | none | The unit of the reported value (after scale), for example V, °C, %, s. Shown with the channel and in the message. seconds, milliseconds, bytes, percent and celsius are read as s, ms, B, % and °C, which the interface formats as times and sizes; any other unit is shown as written. |
name | Value | The name shown for the value channel, up to 80 characters, as plain text. |
class | none | What the object stands for, such as temperature or state: 1 to 40 characters of a-z, 0-9 and _. It is part of the sensor's identity, so one object can be read as two sensors of different classes. Templates imported from LibreNMS set it; leave it out otherwise. |
number_in_text | false | For a text object such as 23.5 C: read the first number in it instead of requiring the whole text to be a number. |
value_map | none | A list of {"value": 2, "label": "degraded", "health": "warning"}. health is up, warning or down and may be left out. A listed value is shown by its label and gives the health. |
expected_text | none | For a text object: the text it must equal, after trimming. |
port | 161 | UDP port of the SNMP agent. |
Suggested interval: 60 seconds. Credential: SNMP.
Integers, gauges, counters and time ticks are numbers. Text that holds a number (12.5) is a number too. Without expected_text, other text is shown in the message and the channel is unknown. Limits on the value channel are set per sensor, as for any channel.
Failures
| Message | Meaning |
|---|---|
the device has no object <oid> (kind protocol) | The agent does not know it, or it is a column without a row index. |
<oid> is "..." but "..." was expected | Down; a text object with the wrong text. |
| SNMP errors | As for snmp_interface. |