OnFailure= hook to each managed unit, and systemd itself starts a short notification job when a unit enters the failed state. The panel can be idle, or even stopped, and alerts still fire.
Alerts need Linux with
systemd. On other hosts, GET /api/settings/alerts reports "supported": false and saving returns 409.Configure
1
Open Settings
Go to Settings > SYSTEMD_FAILURE_ALERTS.
2
Pick a provider and URL
Choose a PROVIDER and paste the WEBHOOK_URL. See providers for the URL format each one expects.
3
Enable and save
Set STATUS: ENABLED and press SAVE_ALERT_CONFIG.
4
Send a test
Press TEST. The panel posts a test message to the saved URL and shows an error if the endpoint does not answer with a
2xx status.Providers
chat_id is required for Telegram. It can be a numeric ID (negative for groups) or an @channelname.
The message is AerosPanel: <service>.service failed. for a real failure and AerosPanel: test alert. for a test.
JSON webhook payload
Failure
Test
URL rules
http://orhttps://only, 4096 characters at most.- No embedded credentials (
user:pass@), no#fragment, and no whitespace or control characters. - Redirects are refused, and requests time out after 10 seconds.
What gets written
Saving an enabled configuration writes three kinds of files:
Files are written to a temporary file and renamed into place, then the panel runs
systemctl daemon-reload.
The drop-in adds one line to each project unit:
/etc/systemd/system/discord-bot.service.d/10-aeros-alerts.conf
alerts.js with Node, with a sandbox:
/etc/systemd/system/aeros-notify@.service
discord-bot.service fails, systemd starts aeros-notify@discord-bot.service.service. The script reads alerts.env and sends one request.
New and deleted projects
- Creating a project while alerts are enabled installs its drop-in right away.
- Deleting a project removes its drop-in.
- Disabling alerts removes every
10-aeros-alerts.confdrop-in.alerts.envstays so you can re-enable without re-entering the URL.
When does a unit fail?
OnFailure= fires each time the unit enters the failed state: the main process exits with a non-zero code, is killed by a signal (including the OOM killer when it hits MemoryMax=), or fails to start. Project units use Restart=always with the default RestartMode=normal, so a crashing service passes through failed, sends an alert, and is restarted 5 seconds later. A service in a crash loop sends one alert per crash.
A clean exit with code 0 and a systemctl stop do not trigger an alert.
To check the hook on a unit: