about summary refs log tree commit diff
path: root/modules/services/monitoring
diff options
context:
space:
mode:
authorJack Cummings <jack@mudshark.org>2012-10-05 22:02:47 -0700
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-09 14:00:59 -0400
commite8d8b6b39997fdd9b0796fd79fffad9750c37774 (patch)
tree79e689ac0e662b66c4a43ef8550f4c4518a0576b /modules/services/monitoring
parent01b8c48c3288243e17cfe1d4b298f4fc2c8bceb5 (diff)
downloadnixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar.gz
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar.bz2
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar.lz
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar.xz
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.tar.zst
nixlib-e8d8b6b39997fdd9b0796fd79fffad9750c37774.zip
smartd: Add options for each device being monitored
Diffstat (limited to 'modules/services/monitoring')
-rw-r--r--modules/services/monitoring/smartd.nix13
1 files changed, 12 insertions, 1 deletions
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"];