Alarms
An alarm philosophy as rules (ISA-18.2 / EEMUA 191): one alarm per cause, acknowledgement and shelving on a tamper-evident record, the shift handover, and paging through signed CloudEvents.
An alarm in flexpool is something an operator must act on. Every alarm type says what happened, what it means if nobody acts, what to do, and how fast; everything else is an event in the history.
Alarm typesπ
The types and their numbers are dated rules in rules/alarms.toml, citing ISA-18.2 and EEMUA 191 β reviewed like any other rule, not hidden in code.
| Alarm | Priority | Raised after | Cleared after |
|---|---|---|---|
| Pool with less than 90 % of its rated power reporting current values | β² high (respond within 15 min) | 2 min | 2 min |
| Connection down β one alarm for the connection, its assets as a count | β medium (30 min) | 30 s | 60 s |
| Asset reports implausible values | β medium (60 min) | 60 s | 60 s |
| Asset without data | β low (4 h) | 5 min | 60 s |
| Asset reports stale values | β low (4 h) | 5 min | 60 s |
| Pool delivery deviates from the schedule by more than 10 % of its battery power, or less than 90 % measured (Delivery) | β medium (15 min) | the quarter hour | the next quarter hour within |
A condition shorter than its delay raises nothing. An alarm is dated when its condition began plus the delay β also when the sandbox clock jumps. Asset alarms behind a connection that is down are suppressed: one cause, one alarm.
Acknowledge, shelve, returnπ
- Acknowledge β one tap. An acknowledged alarm leaves the list when its condition clears; one that clears unacknowledged waits as returned, unacknowledged until someone has seen it.
- Shelve β with a reason, for at most 8 hours (one shift). It comes back by itself when the time is up and the condition is still there.
- Every action records who: the authenticating proxy's user,
token:with the token's fingerprint, orlocal@with the address.
The journalπ
Every alarm raised and cleared, every acknowledgement, shelving, note and handover acceptance β and every trading event (release, withdrawal, halt, resume) β is a line in the journal, each chained to the one before by SHA-256. Set alarms.journal to keep it in a file across restarts:
FLEXPOOL_ALARMS_JOURNAL=/var/lib/flexpool/journal.jsonl flexpoold
flexpool alarms verify /var/lib/flexpool/journal.jsonl # β 1,204 records, chain intactAn altered, removed, inserted or reordered line is named by verify, and flexpoold refuses to start on it. In the sandbox the journal stays in memory.
Handoverπ
Γbergabe (g u) is generated from the journal: active alarms, shelved ones with their return time, what was raised and cleared during the shift, and the notes. The incoming operator accepts it β on the record. It prints cleanly.
Pagingπ
High and medium alarms (configurable) are sent to webhooks as CloudEvents 1.0 signed per Standard Webhooks β what PagerDuty, Opsgenie or Teams integrations accept. A failed delivery is retried after 5 s, 30 s, 2 min, 10 min, 30 min, 1 h, 2 h and 4 h; Integrationen lists every delivery and can send one again. The sandbox never pages.
flexpool alarms secret # prints a whsec_β¦ secret for the receiver and the configuration
export FLEXPOOL_ALARMS_WEBHOOKS=https://events.pagerduty.example/hook
export FLEXPOOL_ALARMS_WEBHOOK_SECRET=whsec_β¦
export FLEXPOOL_ALARMS_DESK_URL=https://desk.example # pages link to the alarm{
"specversion": "1.0",
"id": "630162f1bddfd5ef-17",
"source": "flexpoold",
"type": "de.flexpool.alarm.raised",
"time": "2025-10-01T10:08:01Z",
"subject": "alarm.pool-availability/sued",
"datacontenttype": "application/json",
"data": {
"alarm": "alarm.pool-availability/sued",
"priority": 1,
"title": { "de": "Pool SΓΌd: weniger als 90 % β¦", "en": "Pool SΓΌd: less than 90 % β¦" },
"action": { "de": "β¦", "en": "β¦" },
"respond_minutes": 15,
"since": "2025-10-01T10:08:01Z",
"affected": 4,
"link": "https://desk.example/?view=meldungen&alarm=alarm.pool-availability/sued"
}
}Headers: webhook-id (the event id; deduplicate on it β retries keep it), webhook-timestamp and webhook-signature (v1, + base64 HMAC-SHA256 of id.timestamp.body). Any Standard Webhooks library verifies it. URLs must be HTTPS (HTTP only to loopback) and redirects are not followed.
Measuredπ
Meldungen shows the alarm system against its philosophy over the last 24 hours: alarms per 10 minutes against the target of 1, the busiest 10 minutes and whether that was a flood (10 or more), alarms standing longer than 24 hours, and the most frequent ones β chattering ones marked.
APIπ
| Method | Path | Answer |
|---|---|---|
GET | /api/v1/alarms | Alarms by priority, shelved alarms, the latest records, KPIs |
POST | /api/v1/alarms/acknowledge | {"alarm": "β¦"} |
POST | /api/v1/alarms/shelve | {"alarm": "β¦", "minutes": 60, "reason": "β¦"} |
POST | /api/v1/alarms/unshelve | {"alarm": "β¦"} |
GET | /api/v1/handover?hours=8 | The handover |
POST | /api/v1/handover/notes | {"text": "β¦"} β 1β2,000 characters |
POST | /api/v1/handover/accept | {} |
GET | /api/v1/journal?after=&limit= | Records, oldest first |
GET | /api/v1/deliveries | Webhooks and deliveries |
POST | /api/v1/deliveries/resend | {"id": 7} |
Actions take JSON bodies only (anything else is 415), so a web page elsewhere cannot silence an alarm from the operator's browser. Remote clients need a token.