Skip to main content
NervesHub turns the metrics and alarms your devices report into a health status per device, charts of each metric over time, and a list of the alarms currently raised. To send the data, set up the Health extension in your firmware and turn it on for the product.

Where the data comes from

nerves_hub_link 2.14.0 sends metrics and alarms inside the Health report. It does not implement the standalone Metrics or Alarms extensions. See Metrics and Alarms extensions for which clients do.

Requirements

  • The Health extension turned on for the product and the device. A product created in the web UI starts with every extension on. A product created through the API or nh starts with every extension off. See Extensions overview.
  • NervesHub 2.5.0 or later for health profiles.
  • ClickHouse on the instance for metric history charts, alarm history, and health profiles. See What works without ClickHouse and Feature prerequisites.

Health status

Each device has one of these statuses: NervesHub works the status out again each time the device reports metrics. When the device is not connected, its badge reads No recent data. The status appears in these places:
  • The Health card on the device’s Details tab, with a tile for each featured metric.
  • The Now card on the device’s Health tab, with every metric the device last reported. The Health tab carries a dot while a threshold is engaged.
  • The devices list. Filter by health under Status, and by alarm or metric value under Alarms and metrics. See Finding devices.
A change of status can also be sent to your own systems as the device.health_status_changed event. See Webhooks.

Health profiles

A health profile is the set of thresholds that decides a device’s status. Profiles belong to a product. Every product has a Default profile. You can add a profile for a platform. A device whose firmware reports that platform uses its profile. Every other device uses Default.

Default thresholds

A new product’s Default profile starts with four metrics, each measured over 1 hour and each featured:

How a threshold engages

Each metric in a profile has two levels, Warning and Unhealthy. Each level has a threshold and a period, from 1 minute to 24 hours. A level engages when the metric’s median over that level’s period reaches the threshold: at least half the readings in the period are at or past it. By default a metric is unhealthy at or above its thresholds. You can flip a metric so that it is unhealthy at or below them, for values where low is the problem.
A device nobody is watching reports once an hour by default. A short period then holds one reading at most. Use a period of several hours if you want more than one reading to count.

Edit a profile

You need a role that can update the product.
1

Open the profile

Open the product, go to Settings, and select the Device health tab. Pick a profile under Profiles.
2

Add or change metrics

Use Add a metric… to add any metric your devices report, or a built-in one. For each metric, set the Warning at and Unhealthy at thresholds and their periods. Click the ≥ or ≤ button to flip which direction is unhealthy.NervesHub offers Use suggested on a metric when it has at least a week of your fleet’s readings for it and its suggestion differs from the thresholds you have. The suggestion marks what is unusual for your fleet.
3

Choose the featured metrics

Click the star in the Featured column. A featured metric gets a tile at the top of the device page. Metrics that are not featured still count toward health and still show on the Health tab.
4

Check the effect and save

The bar above the metrics shows how many of the profile’s devices are healthy, warning, unhealthy or without data Right now. While you have unsaved changes it shows the counts If you save. Click Save profile, or Discard.

Add a platform profile

On the Device health tab, click Add a platform profile and choose a platform. The list holds the platforms reported by firmware uploaded to the product that do not have a profile yet. To remove a platform profile, open it and click Delete profile. Its devices go back to Default. You cannot delete Default.

Built-in metrics

A profile can include a metric that NervesHub measures itself: A built-in metric cannot be featured.

Metric charts

The device’s Health tab has a History card with a chart for each metric the device reports.
  • Choose a time frame of 3 hours, 1 day or 7 days.
  • Drag across a chart to zoom all of them. Click Reset zoom to go back.
  • Switch between Line and Scatter chart styles.
Sizes that only qualify another metric (mem_size_mb, disk_total_kb, disk_available_kb) are not charted. Metric history is kept for 30 days. Each reading records the firmware the device was running, so you can compare a metric across releases. You can also read history from outside NervesHub:
See the CLI reference and the API overview.

Alarms

Your firmware raises and clears alarms, and NervesHub shows the set that is currently raised. A metric crossing a threshold changes the device’s health status, not its alarms. The Alarms row sits at the foot of the Health card on the Details tab and the Now card on the Health tab. It shows how many alarms are active. Each alarm is listed with its name, its description, and when it was raised. With no alarms it reads None active. The row appears when Health or Alarms is turned on for both the product and the device. How quickly an alarm shows up depends on how the device sends it: A device that disconnects keeps its alarms in NervesHub. They are corrected when it reconnects and reports again. To set up alarms in firmware, see Alarms in the Health extension.

What works without ClickHouse