22 Commits
Author SHA1 Message Date
menzelandClaude Opus 4.8 6b75401aec epics2sms: move site config to an untracked epics2sms.conf
Split all site-specific settings (RECIPIENTS, FROM_ADDR, ALERT_SUBJECT,
CA_TIMEOUT, MONITORS) out of EPICS2SMS.sh into a separate config file that
is sourced at startup, so "git pull" no longer clobbers local settings.

- epics2sms.conf is git-ignored (local, per-host).
- epics2sms.conf.example is tracked and documents the format.
- Config path: first CLI arg > EPICS2SMS_CONF env var > epics2sms.conf beside
  the script. Missing config or empty RECIPIENTS/MONITORS exits with a clear
  error pointing at the template.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:55:36 +02:00
menzelandClaude Opus 4.8 421c670e26 epics2sms: include the running user in the startup notification
Add "by <user>" (effective user via id -un) to the startup message so
recipients can see who started the monitor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:41:21 +02:00
menzelandClaude Opus 4.8 513252a60c epics2sms: only send RESOLVED if an alarm message was sent this episode
Guard the recovery notification on msg_count > 0, so a brief excursion that
never produced an alarm message (e.g. recovered before any send, or all
sends failed) does not emit a lone RESOLVED. Recovery is still logged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:38:49 +02:00
menzelandClaude Opus 4.8 9aa5e463f8 epics2sms: throttle alarm messages (msg_delay) and send a recovery message
Add a per-monitor msg_delay_s (default 300s): polling continues at the
alarm rate to keep the average and recovery check fresh, but alarm messages
are throttled to at most one per msg_delay_s. The first message of an
episode is still sent immediately.

Also send one "RESOLVED" notification when a monitor returns to normal
(immediate, not throttled or capped).

Config format: pv | dir | threshold | poll_s | alarm_poll_s | n_avg | n_msg | msg_delay_s | text

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:35:53 +02:00
menzelandClaude Opus 4.8 8aed753815 epics2sms: send a brief startup notification listing monitored PVs
On startup, send one message to all recipients summarising each active
monitor (PV/threshold text, poll and alarm intervals, averaging window,
message cap) so recipients can confirm the monitor is running and what it
watches. Best-effort: a send failure does not stop monitoring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 11:16:03 +02:00
menzelandClaude Opus 4.8 371d4939a0 epics2sms: pass a Channel Access timeout to caget (-w)
The caget default (~1s) can be too short for the first connection to a PV,
which then surfaces as "Process variable not connected" and gets skipped.
Add a configurable CA_TIMEOUT (default 5s) and pass it as caget -w.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 11:13:39 +02:00
menzelandClaude Opus 4.8 5f5872ec82 epics2sms: multi-monitor with moving average, directional thresholds, message cap
Rewrite epics2sms.sh from a single-PV/single-alert monitor into a driver
that runs multiple independent monitors from a MONITORS config array, each
as its own background loop with isolated state.

Per monitor:
- directional threshold (lt/gt) on a moving average over the last n_avg
  samples ("N Mittel"); alarm only fires once the window is full, so a
  single spurious reading cannot trigger it
- separate normal and alarm poll intervals; one message is sent per alarm
  poll, so alarm_poll_s governs the minimum spacing between messages
- up to n_msg messages per alarm episode ("N Messages"), then silent;
  counter resets on recovery
- unreadable/non-numeric reads are logged and skipped

Config format: pv | dir | threshold | poll_s | alarm_poll_s | n_avg | n_msg | text
Recipient updated to 0041797554007@sms.switch.ch. README updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 11:03:12 +02:00
menzel 9dbb85a57d extending fix_dir_mtime.py to work on symbolic links, too 2026-02-25 10:28:30 +01:00
menzel d5e1817503 making fix_dir_mtime.py more robust 2026-02-25 10:18:40 +01:00
menzel 9a7d05ba77 first attempt for fix_dir_mtime.py, plus some minor changes 2026-02-25 10:12:24 +01:00
menzel a0a5b3321c openai.py, a simple shell interface to openai 2026-02-14 18:27:18 +01:00
menzel 6761e5d703 script to detect broken links 2026-01-29 18:14:26 +01:00
menzel ff00c7e4d8 foswiki_html2gitea_md.py for automated mapping of the old cSAXS Wiki to Gitea 2026-01-28 15:05:26 +01:00
menzel a0b6b7ddea adding a README 2026-01-22 18:51:38 +01:00
menzel 499bf058e3 Refactor EPICS2SMS: explicit SMTP via smtp.psi.ch, no local sendmail 2026-01-22 18:46:53 +01:00
menzel 13c8881ec8 correcting From Field 2026-01-20 19:19:48 +01:00
menzel a0decee61f adding a From field for sendmail 2026-01-20 17:48:42 +01:00
menzel 358612ab99 switching to Swisscom (from Switch) for the SMS service 2026-01-20 15:03:03 +01:00
menzel d4ccab2ca9 cleaning up EPICS2SMS.sh 2025-12-12 22:19:09 +01:00
menzel 62249261a2 fixing a typo in EPICS2SMS.sh 2025-12-12 19:25:52 +01:00
menzel ac1f9648c1 first tested version of script for consoles to send SMS depending on an EPICS PV 2025-12-12 19:12:14 +01:00
menzel 7ff26cb00b Initial public release of competence factor extractor 2025-10-29 11:22:58 +01:00