flexpool

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.

Alarms: one medium alarm, 'Pool Nord: delivery deviates from the schedule', with the affected assets, the response time and the Acknowledge and Shelve buttons.

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.

AlarmPriorityRaised afterCleared after
Pool with less than 90 % of its rated power reporting current valuesβ–² high (respond within 15 min)2 min2 min
Connection down β€” one alarm for the connection, its assets as a countβ—† medium (30 min)30 s60 s
Asset reports implausible valuesβ—† medium (60 min)60 s60 s
Asset without data● low (4 h)5 min60 s
Asset reports stale values● low (4 h)5 min60 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 hourthe 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πŸ”—

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 intact

An 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πŸ”—

MethodPathAnswer
GET/api/v1/alarmsAlarms 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=8The 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/deliveriesWebhooks 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.

Edit this page