Get an email upon failed systemd services

Only by chance, I noticed a failed systemd service. It&rsquo;s a rather crucial service, namely my backup . I&rsquo;ve decided to get notified by email in such circumstances. The solution consists of three parts: The actual backup service unit A unit status mail service A python email script On failure, the actual service triggers the email service which in turn triggers the email script. The %h…