Skip to content

Combined (combined) ​

Computes channels from chosen channels of other sensors: the sum of the traffic of two uplinks, the average of the temperatures of a rack, the busiest of three links, the difference of two counters. Its own state comes from the states of the sensors it reads together with limits you set on the computed channels, and it goes through everything a sensor goes through: limits, the failure count, incidents, notifications, dependencies, pauses, maintenance windows and history.

A combined sensor is never polled. It is computed inside Probeward from what the other sensors already show, so it needs no credential and no network access, and it runs in the core even when its sources are on remote probes. Its interval is how often a value is recorded.

What it looks like ​

The page of a combined sensor in the light theme

The sensor's page after a few evaluations: the total and the slowest of the response time of an HTTP check and the connect time of a TCP check, both ordinary sensors on a web server. In the dark theme: the sensor's page. The form for adding it, with the inputs chosen from the tree and from each sensor's channels: light, dark.

Setting one up ​

  1. Add a sensor of kind Combined to a device. The device's address is not used; any device will do, for example a "Totals" device. The sensor is subject to that device's master check like any sensor on it.
  2. Add a channel: a name, a function, and a unit if it has one. The key is made from the name and can be changed; history is kept under it, so choose it once.
  3. Under Inputs, search for a sensor and click it, then choose which of its channels to read. Add as many inputs as the function needs. A difference takes exactly two: the first minus the second.
  4. Add more channels if you want them. Set the sensor's interval and its limits on the computed channels on the sensor's page.

Parameters ​

ParameterDefaultMeaning
channelsnone, required1 to 20 channels to compute, each with key, name, optional unit, function and inputs.
state_from_sourcestrueTake the sensor's own health from its sources: the worst of them. Limits on the computed channels apply either way.
missingunknownWhat a channel does when an input has no value: unknown (the channel has no value) or skip (compute it from the inputs that have one).

A channel is {"key": "total", "name": "Total traffic", "unit": "bit/s", "function": "sum", "inputs": [{"sensor": "<id>", "channel": "in_bps"}, ...]}. The function is sum, average, min, max or difference, and an input is a sensor (by id) and one of its channel keys. The form chooses both from lists. A key is 1 to 64 lower-case letters, digits and underscores and is used by one channel only; there are at most 50 inputs to a channel.

Channels ​

The sensor's channels are the ones its parameters define. Each is shown with the name and the unit you gave it, on the sensor's page, in charts, in the tree and in notifications. Limits on them are set per channel as on any sensor, in the sensor's channel table; there are no default limits.

What counts as a value ​

An input has a value when its source is fresh (its last poll succeeded and recently) and the source reports that channel with a number. The last good value of a source that is failing, paused, stale, on a probe that is not reporting or deleted is not used: a total of old numbers would be taken for a total of current ones. By default a channel with an input that has no value has no value either, because a sum of some of the inputs would be taken for the sum of all of them; set missing to skip where that is what you want, such as the busiest of three redundant links (a difference always needs both). A value that is not a finite number has no value.

How the state is decided ​

With state_from_sources on, the sensor's health is the worst of the states of the sources it reads (up, warning or down: a source counts as down once it is confirmed failing, and as warning before that), together with the limits on the computed channels. A source that cannot be read leaves its channels without a value, is named in the message and does not make the sensor fail. When none of the sources can be read the sensor is Unknown: it decides nothing, counts nothing towards its failure count and does not open or recover an incident. With state_from_sources off only the limits on the computed channels decide.

Failure means ​

A source is down, or a computed channel crossed a limit. A source that is down pages on its own as well; to page only for the total, set the notification rules of the sources to nobody and those of the combined sensor to your team.

Things to know ​

  • The values are recorded on the sensor's own interval, not at every poll of every source, so a chart of the total has one point per interval. A change of state of a source is evaluated at once.
  • A combined sensor cannot be a master check or a dependency. Sensors that read each other in a circle are refused when you save.
  • Sources are named by id in the parameters; see business process for what that means for export, import and cloning, and for who may name which sensor.

Testing ​

The functions, missing inputs, the state from the sources, limits on the computed channels and stale sources are checked on a simulated clock in crates/probeward-engine/tests/derived.rs and in the unit tests of crates/probeward-engine/src/derived.rs. The runtime test (crates/probeward-server/tests/runtime/derived.rs) runs a real server on PostgreSQL with two scripted sources and checks the sum and the maximum on the sensor's status, and that deleting a source leaves the total without a value, with the reason in the message. The screenshots come from ui/e2e/91-sensor-screenshots.spec.ts.

AGPL-3.0-only