Notify of disk errors via email

This commit is contained in:
2020-09-06 00:39:40 +02:00
parent 6bdb0123d1
commit 782f5c2024
3 changed files with 31 additions and 6 deletions

23
modules/monitoring.nix Normal file
View File

@@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
{
# Notify when a disk starts going haywire
services.smartd = {
enable = true;
notifications.mail = {
enable = true;
recipient = "akasroua@gmail.com";
};
};
# Enable trivial MTA for smartd notifications
services.ssmtp = {
enable = true;
useTLS = true;
useSTARTTLS = true;
domain = "gmail.com";
hostName = "smtp.gmail.com:587";
authUser = "akasroua@gmail.com";
authPassFile = "/run/keys/ssmtp";
};
}