System Monitoring (with systemd)

Prerequisites: Email (msmtp).

We can set up systemd to notify us by email if a service fails. Systemd actually does this by starting another service.


We can create the notification service at /etc/systemd/system/[email protected]

Description=Send email

ExecStart=/usr/bin/sh -c 'printf "Subject: [systemd] %i Failed" | /usr/bin/msmtp default'

This can easily be tested with systemctl start [email protected].


This notification method can be used by our other systemd services by adding the line:

OnFailure[email protected]%N


We add the files to our backup script:

    /etc/systemd/system/[email protected] \

results matching ""

    No results matching ""