AvrelDocs

Alerts and collector health

Collectors at remote sites go quiet: the power drops, the mobile link fails, the computer overheats or hangs. Avrel tells you when that happens, shows what the collector reported in its last minutes, makes a best guess at the cause, and tells whoever visits the site what to check.

Everything here works the same for any collector on any Linux computer. Avrel uses only what the collector measured. When the hardware cannot report a reading, Avrel shows No data for it rather than a guess.

What a collector reports about itself#

Each reading a collector sends includes the health of the computer it runs on (version 0.5 or later):

ReadingWhere it comes from on LinuxShown when
Supply alarmUndervoltage or low-voltage alarm from /sys/class/hwmon (in*_lcrit_alarm, in*_crit_alarm, in*_min_alarm). The collector also checks it every 5 seconds between readings, so a short dip is not missed.The board reports a supply alarm, as most single-board computers and many industrial PCs do.
Supply voltagesMeasured rails in /sys/class/hwmon (in*_input).The board has a voltage monitor.
Battery and mains/sys/class/power_supply: battery charge and voltage, and whether external power is present.The computer has a UPS, battery or power-management chip that reports them.
TemperatureThe hottest zone in /sys/class/thermal.Almost always.
Free memory and swap/proc/meminfo.Always.
Free diskThe disk the queue is on.Always.
NetworkThe interface that carries the default route: link up or down, errors, and Wi-Fi signal from /proc/net/wireless if it is wireless.Always. Wi-Fi signal only on Wi-Fi.
Uptime and load/proc/uptime, /proc/loadavg.Always.
Upload queueHow many readings are waiting to upload, and how many uploads in a row failed.Always.

The first reading after the collector starts also says why it started: its first start, a restart of the collector program, or a reboot of the computer, whether the last run stopped cleanly, whether a hardware watchdog was armed, and whether the watchdog caused the reboot (from /sys/class/watchdog).

None of this needs extra access. The collector reads these files as an unprivileged user and still cannot open hardware devices.

Open a collector's health from Edge > Collectors with Health. The panel shows the latest readings, a small line for each over the last 30 minutes, the likely cause and the collector's events.

When a collector stops reporting#

Each collector has an alert delay, 10 minutes unless an owner changes it in the collector's health panel (3 minutes to 24 hours, or never). When nothing has arrived for longer than that:

  1. The collector shows STOPPED REPORTING.
  2. Avrel records an event with what the collector reported in its 30 minutes before it went quiet, and works out a likely cause from them.
  3. Every alert channel of the organization gets one alert, with the likely cause and the site checklist for that cause.

When the collector reports again:

  1. Avrel closes the event and works out the cause again, now also using how it came back. For example, readings from the gap arriving from the queue mean the collector kept working and only the link was down. A reboot without a clean shutdown and nothing recorded during the gap looks like a loss of power.
  2. The channels get a back online alert with how long it was quiet and the updated cause.

A collector restart that happens without the collector going quiet for long, for example the service watchdog restarting a hung collector, is recorded as an event and sent as a restarted alert.

How the likely cause is worked out#

Avrel applies fixed rules. It uses no model and no hidden scoring. Each rule that matches adds its weight to one cause. A cause with 2 points or more is shown as likely, 1 point as possible. The app lists every rule that matched, with the reading, its time and the rule ID, so anyone can check the conclusion. It is always a best guess to confirm on site.

RuleCauseWeightWhen it applies
PWR-1Power2A supply alarm in the last 30 minutes.
PWR-2Power2External power reported lost, running on battery.
PWR-3Power1A supply rail or battery voltage fell by 5% or more.
PWR-4Power1Battery charge 10% or less.
PWR-5Power2, or 1 without a hardware watchdogOn return: a reboot without a clean shutdown, no watchdog reset, and nothing recorded during the gap. Without an armed hardware watchdog it counts only 1, because a hang that someone power-cycled looks the same.
NET-1Network3On return: readings taken during the gap were uploaded from the queue.
NET-2Network2Network link down, or no route to the internet.
NET-3Network1Wi-Fi signal -80 dBm or weaker, or 10 dB or more below its typical level.
NET-4Network1Uploads failing or readings queuing just before it went quiet.
HOST-1The collector computer3On return: the hardware watchdog reports it rebooted the computer.
HOST-2The collector computer2Temperature 80 °C or more, or a rise of 10 °C or more to 70 °C or more.
HOST-3The collector computer2Free memory 10% or less, or a fall of 20 points or more.
HOST-4The collector computer2Free disk 5% or less.
COL-1The collector program2On return: the collector restarted on the same boot without stopping cleanly.

If no rule matches, Avrel says so ("None of the readings it sent points to a cause") rather than guessing. That is a result too: a collector whose supply, temperature, memory, disk and network were all normal until it stopped, and that comes back after an unclean restart, most often lost its power suddenly or froze. Arming the hardware watchdog (see Running a collector) tells those two apart next time.

Alert channels#

Owners add channels in Edge > Collectors > Alerts. Members can see them. Use Send test after adding one.

KindWhat you giveWhat it receives
WebhookAn https:// address on the public internet.A JSON POST for each alert. You see a signing secret once: check the X-Avrel-Signature header, which is sha256= followed by the HMAC-SHA256 of the raw body with that secret. X-Avrel-Event names the event. Redirects are not followed.
SlackA Slack incoming webhook address (https://hooks.slack.com/...).A message in that channel.
PagerDutyAn Events API v2 integration key.An incident when a collector stops reporting, resolved automatically when it is back. Restarts are not sent to PagerDuty.
EmailUp to ten addresses.A plain-text email. Only available when the Avrel server has outgoing mail set up.

Every channel can be set to skip restart alerts. The last result of each channel is shown next to it, and each event lists whether its alerts went out.

Webhook alerts have this shape (fields with no value are left out):

{
  "type": "collector.silent",
  "event_id": "evt_col_3f2a9c81d0e4_1795230852",
  "org_id": "acme", "org_name": "Acme Robotics",
  "collector_id": "col_3f2a9c81d0e4", "collector_name": "Cell 4 gateway", "unit_id": "CELL-4",
  "last_seen_at": 1795230852.6, "silent_for_s": 612.0, "quiet_since": 1795230850.1,
  "diagnosis": { "summary": "Likely cause: power. Supply alarm in 4 of the last 30 reports.", "causes": [], "hypothesis": true },
  "checklist": { "cause": "power", "items": ["Check the collector computer has power: ..."] },
  "url": "https://avrel.example.com/#v=1&org=acme&page=edge&col=col_3f2a9c81d0e4",
  "subject": "Avrel: Cell 4 gateway (Acme Robotics) has stopped reporting",
  "text": "..."
}

type is one of collector.silent, collector.back_online, collector.restarted or test.

Site checklists#

Each alert ends with what to check on site for the likely cause, so whoever visits does more than switch it off and on again. Avrel comes with general checklists for power, network, the collector computer, the collector program, and no clear cause. Owners can reword them for their sites under Alerts > Site checklists, for example to name the breaker, the router or the person to call. Reset to default brings back the original wording.

For the Avrel server operator#

  • Checking for quiet collectors. A self-hosted server (server/app.py) checks every 30 seconds by itself. A hosted server that only runs on requests, such as one on Vercel, also checks during normal traffic, but needs a scheduler to be sure: set AVREL_CRON_SECRET (or CRON_SECRET) and have any scheduler call GET /api/cron/collectors with Authorization: Bearer <secret> every minute or few minutes.
  • Email. Set AVREL_SMTP_URL (for example smtps://user:password@smtp.example.com:465, or smtp://...:587 for STARTTLS) and AVREL_MAIL_FROM. Without them, email channels cannot be added.
  • Links. Alerts link back to the app at AVREL_PUBLIC_URL, or at the address people last opened the app at.