Skip to content

A systemd unit for sending e-mail notifications in case of failure.

License

Notifications You must be signed in to change notification settings

nchevsky/systemd-send-mail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

  1. Install to /etc/systemd/system:

    • send-mail@.service: systemd unit
    • send-mail: Script invoked by send-mail@.service to send an e-mail
  2. Optionally configure recipient's and sender's e-mail addresses in send-mail:

    RECIPIENT=jdoe@example.com
    SENDER=jschmoe@example.com
    

    These default to root@<hostname> and <failed-unit-user>@<hostname>.

  3. Add to the unit(s) of whose failures you would like to be notified:

    [Unit]
    ...
    OnFailure=send-mail@%N.service
    ...
    
  4. Reload the modified unit(s):

    $ sudo systemctl daemon-reload
    

About

A systemd unit for sending e-mail notifications in case of failure.

Resources

License

Stars

Watchers

Forks

Languages