Add SMART monitoring

This commit is contained in:
coolneng 2021-03-15 14:00:59 +01:00
parent 9ddf94f567
commit c03e5601ba
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 24 additions and 0 deletions

View File

@ -90,6 +90,7 @@
./modules/networking.nix ./modules/networking.nix
./modules/datasync.nix ./modules/datasync.nix
./modules/virtualization.nix ./modules/virtualization.nix
./modules/monitoring.nix
]; ];
} }

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 = "/var/keys/ssmtp";
};
}