diff --git a/modules/zabbix-agent.nix b/modules/zabbix-agent.nix index faae769..3846d9f 100644 --- a/modules/zabbix-agent.nix +++ b/modules/zabbix-agent.nix @@ -22,6 +22,19 @@ in pkgs.smartmontools ]; users.users.zabbix-agent.extraGroups = [ "systemd-journal" ]; + + #allow zabbix-agent to run smartctl + security.sudo.extraRules = [ + { + users = [ "zabbix-agent" ]; + commands = [ + { + command = "${pkgs.smartmontools}/bin/smartctl"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; } # vim: set et ts=2 sw=2 ai: