From e8d8b6b39997fdd9b0796fd79fffad9750c37774 Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Fri, 5 Oct 2012 22:02:47 -0700 Subject: [PATCH] smartd: Add options for each device being monitored --- modules/services/monitoring/smartd.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/services/monitoring/smartd.nix b/modules/services/monitoring/smartd.nix index 2427f29020ea..7ca5625bfe77 100644 --- a/modules/services/monitoring/smartd.nix +++ b/modules/services/monitoring/smartd.nix @@ -24,7 +24,7 @@ let smartdConf = pkgs.writeText "smartd.conf" (concatMapStrings (device: '' - ${device} -a -m root -M exec ${smartdMail} + ${device} -a -m root -M exec ${smartdMail} ${cfg.deviceOpts} '' ) cfg.devices); @@ -50,6 +50,17 @@ in ''; }; + deviceOpts = mkOption { + default = ""; + type = types.string; + example = "-o on -s (S/../.././02|L/../../7/04)"; + description = '' + Additional options for each device that is monitored. The example + turns on SMART Automatic Offline Testing on startup, and schedules short + self-tests daily, and long self-tests weekly. + ''; + }; + devices = mkOption { default = []; example = ["/dev/sda" "/dev/sdb"];