mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-27 06:10:53 +01:00
Adaped status mails for lisa
This commit is contained in:
parent
44bf16ddf0
commit
fa7660ddfc
3 changed files with 26 additions and 7 deletions
|
@ -25,6 +25,11 @@
|
|||
enable = true;
|
||||
subdomain = "ci";
|
||||
};
|
||||
zfs-mails = {
|
||||
enable = true;
|
||||
name = "lisa";
|
||||
smart.enable = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ in
|
|||
subdomain = "cloud";
|
||||
};
|
||||
zfs-mails.enable = true;
|
||||
zfs-mails.name = hostName;
|
||||
zfs-mails.smart.enable = true;
|
||||
};
|
||||
|
||||
networking.hostName = hostName;
|
||||
|
|
|
@ -26,7 +26,7 @@ let
|
|||
];
|
||||
});
|
||||
|
||||
hostName = "newton";
|
||||
hostName = cfg.name;
|
||||
sendEmailEvent = { event }: ''
|
||||
printf "Subject: ${hostName} ${event} ''$(${pkgs.coreutils}/bin/date --iso-8601=seconds)\n\nzpool status:\n\n''$(${pkgs.zfs}/bin/zpool status)" | ${pkgs.msmtp}/bin/msmtp -a default ${emailTo}
|
||||
'';
|
||||
|
@ -36,10 +36,14 @@ with lib;
|
|||
{
|
||||
options.luj.zfs-mails = {
|
||||
enable = mkEnableOption "enable zfs status mails";
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
smart.enable = mkEnableOption "enable smart deamon";
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf cfg.enable (mkMerge [{
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
zfsStable = customizeZfs pkgs.zfsStable;
|
||||
|
@ -63,10 +67,7 @@ with lib;
|
|||
ZED_EMAIL_OPTS = "-a 'FROM:${emailFrom}' -s '@SUBJECT@' @ADDRESS@";
|
||||
ZED_NOTIFY_VERBOSE = true;
|
||||
};
|
||||
services.smartd.enable = true;
|
||||
services.smartd.notifications.mail.enable = true;
|
||||
services.smartd.notifications.mail.sender = emailFrom;
|
||||
services.smartd.notifications.mail.recipient = emailTo;
|
||||
|
||||
|
||||
systemd.services."boot-mail-alert" = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
@ -99,7 +100,18 @@ with lib;
|
|||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.smart.enable {
|
||||
services.smartd.enable = true;
|
||||
services.smartd.notifications.mail.enable = true;
|
||||
services.smartd.notifications.mail.sender = emailFrom;
|
||||
services.smartd.notifications.mail.recipient = emailTo;
|
||||
|
||||
|
||||
})
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue