modules/services/monitoring/smartd.nix: added support for running smart daemon
Set "services.smartd.enable = true" to enable the service. svn path=/nixos/trunk/; revision=27767
This commit is contained in:
parent
e056880dc4
commit
fb1b0c0372
@ -15,7 +15,7 @@
|
||||
./hardware/network/intel-2100bg.nix
|
||||
./hardware/network/intel-2200bg.nix
|
||||
./hardware/network/intel-3945abg.nix
|
||||
./hardware/network/rt73.nix
|
||||
./hardware/network/rt73.nix
|
||||
./hardware/pcmcia.nix
|
||||
./installer/generations-dir/generations-dir.nix
|
||||
./installer/grub/grub.nix
|
||||
@ -83,6 +83,7 @@
|
||||
./services/misc/virtualbox.nix
|
||||
./services/monitoring/monit.nix
|
||||
./services/monitoring/nagios/default.nix
|
||||
./services/monitoring/smartd.nix
|
||||
./services/monitoring/systemhealth.nix
|
||||
./services/monitoring/zabbix-agent.nix
|
||||
./services/monitoring/zabbix-server.nix
|
||||
|
48
modules/services/monitoring/smartd.nix
Normal file
48
modules/services/monitoring/smartd.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.smartd;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.smartd = {
|
||||
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
example = "true";
|
||||
description = ''
|
||||
Run smartd from the smartmontools package.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
jobs.smartd =
|
||||
{ description = "S.M.A.R.T. Daemon";
|
||||
|
||||
startOn = "started syslogd";
|
||||
|
||||
daemonType = "daemon";
|
||||
|
||||
exec = "${pkgs.smartmontools}/sbin/smartd";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user