Temperature and humidity probes over SNMP (snmp_environment)
Reads the temperature and humidity probes of an environment monitor, a rack power distribution unit, a UPS management card, or any device with sensors in a standard MIB. The lowest and highest temperature and humidity of the probes are channels with limits, and every probe is a channel of its own, named as the device names it.
Source (source) | Reads | Devices |
|---|---|---|
apc | The PowerNet MIB: the probes of environment monitors on UPS cards (iem, em), environment management units (ems), modular environment monitors (mem), wireless sensors, and the temperature and humidity sensors of rack PDUs | APC environment monitors, rack PDUs and UPS cards |
entity | The standard ENTITY-SENSOR-MIB: sensors of type celsius and percentRH, named from ENTITY-MIB | Switches, firewalls and other devices that have them |
lm_sensors | The UCD LM-SENSORS-MIB of net-snmp agents: temperature sensors, in thousandths of a degree | Linux hosts and appliances running net-snmp with lm_sensors. These are chip temperatures: set limits for them, the defaults below are for a room |
auto (the default) | The APC tables, then the entity sensors, then the net-snmp sensors; the first that has probes | Any of the above |
Devices whose probes are in another vendor's MIB (Sensorsoft and similar) are not read by a source of their own. If such a device serves the standard entity sensor MIB, entity reads it. Otherwise import its MIB and pick the temperature and humidity objects: you get an snmp_custom_oid sensor for each, with the unit and scale the MIB gives.
What it looks like

The sensor's page after a few polls, reading an APC environment monitor. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
temperature_max_c | Highest temperature | °C | warning above 28, error above 35 |
temperature_min_c | Lowest temperature | °C | warning below 15, error below 10 |
humidity_max_pct | Highest humidity | % | warning above 70, error above 80 |
humidity_min_pct | Lowest humidity | % | warning below 25, error below 15 |
probes | Probes | none | none |
probe_<id>_temp_c, probe_<id>_humidity_pct | the probe's name, with temperature or humidity | °C, % | none. Set limits on the sensor. |
The limits suit a server room; change them for a cold store or a warehouse. Temperatures read in Fahrenheit are converted to Celsius, using the unit the device says it reports in. A probe that is unplugged, or whose communication is lost, is left out; a probe with no humidity element is not given a humidity (some report 0). A temperature outside -60 to 250 °C is treated as a probe fault and left out. At most twelve probes get channels of their own, in the order the device lists them; the lowest and highest cover all. The probe's key is made from the table it came from and its index, so it stays the same when other probes are added.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
source | auto | Where to look: auto, apc, entity or lm_sensors. |
probe_contains | none | Only probes whose name contains this text, without regard to case. Use it to give each rack its own sensor when one device serves several. |
port | 161 | UDP port of the SNMP agent. |
Suggested interval: 60 seconds. Credential: SNMP. Discovery adds this sensor to a device that has a probe that answers in an APC table. It does not look at the standard entity sensors, because switches list their optical transceivers there, nor at the net-snmp sensors, because a host lists the temperatures of its chips there, which are far above a room's and would page at once under the limits below. Add it by hand where wanted, and set limits that suit what it reads.
Failures
| Message | Meaning |
|---|---|
the device has no temperature or humidity probe ... that answers (source: ...) (kind protocol) | No such probe, none plugged in, or the name filter matches none. |
| SNMP errors | As for snmp_interface. |
Verification
| Checked against | What it showed |
|---|---|
| Recordings of APC devices, replayed by an SNMP simulator, live: an environment monitor (probes listed in two tables, counted once), an environmental manager, a UPS card with an integrated probe, and a wireless sensor system of seventeen probes (temperatures in tenths) | The lowest and highest temperature and humidity, a probe with no humidity element, and each probe as a channel with its name. |
| Recordings of a NAS and a Raspberry Pi with net-snmp sensors, and of an Arista switch and a Palo Alto firewall with entity sensors, live | Temperatures in thousandths of a degree, and scaled entity sensors (auto finds each in turn). |
| Recordings of APC devices with a probe that is unplugged, a PDU sensor that is not installed, and no probe at all, live | These are left out and the sensor says there is no probe, instead of reporting 0 °C. Discovery does not add the sensor to them. |
| Scripted answers built from the PowerNet MIB | Fahrenheit probes converted, a PDU sensor with and without a humidity element, probes by name, a probe listed twice, and a name filter that matches nothing. |
Not seen: a PDU sensor with a reading (the PDU recordings have none installed), the older em table of UPS cards (read by the code that reads iem, which was seen), Fahrenheit on a real device (the recordings are Celsius), probes in alarm, SNMPv3, and any device of Sensorsoft or another vendor with its own MIB.
The live tests read the simulator through PROBEWARD_TEST_SNMPSIM_HOST, PROBEWARD_TEST_SNMPSIM_PORT and PROBEWARD_TEST_SNMPSIM_COMMUNITIES (see tests/snmpsim_live.rs), and skip without them. The recordings are GPL and are not in this repository.