-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendmail support #29
Comments
For sending mails we have |
I already employ a very similar homegrown solution1. (for some reason systemd-user-mail requires postfix?) But when health-checker fails, is there actually any guarantee that a systemd service has failed? And thus an email sent? As far as I can tell from reading the logic, health-checker either reboots or isolates to emergency.target when a plugin fails. |
My solution would be to implicitly call sendmail, which could provide more details like what plugin failed, what the BTRFS snapshots are and in what stage of recovery health-checker is. As for the choice of sendmail over solutions like mailx. Mailx is a simple SMTP client but there are other SMTP clients that provide compatible sendmail binaries like msmtp. By using sendmail the sysadmin can use any MTA or a thin wrapper to an SMTP client like with msmtp. Mail should be globally configured anyway. If a user would choose msmtp via sendmail to use with systemd-status-mail the same configuration would work for health-checker. If you think this is a good idea I can just make an experimental PR. |
No, if health-checker fails the system is not in an healthy state and thus sending emails will most likely also fail.
Make sure that health-checker logs this all to the journal and it will be in the mail send to you. This are no information which we should try to send by mail (which will most likely fail), but where we should try to log them on local disk. The chances that this works are higher. Else I don't understand your comments about sendmail and mailx. systemd-status-mail uses sendmail if available, but most systems today don't have a configured/working sendmail/postfix/..., so using mailx to send the mail to the next relay is what people are doing and using out there. |
You can add something generic as systemd-status-mail has, but in most cases I'm aware of there would be no way to send emails from health-checker since the system is not working and most of the time network not available. |
What would then trigger that to be sent? ie. when using
I agree that when the health-checker fails with the default plugins it is unlikely that emails get sent. However I use MicroOS as a database server, and I would like the health-checker to verify that the postgres database is up. If it isn't then I would like it to rollback, I am not sure if this is the intended usecase for health-checker though. However it seems competent enough to verify higher-level services are running. In this scenario I would receive an email of the postgres service failing only if health-checker doesn't reboot before the email is sent. |
Currently telem is supported for logging, but there's no support for sending mail with sendmail.
This should be trivial to implement.
The text was updated successfully, but these errors were encountered: