From 959801a1d0837ba84fbbdd81a8ba09f46f2caa6e Mon Sep 17 00:00:00 2001 From: nyanloutre Date: Mon, 4 Jun 2018 12:31:07 +0200 Subject: [PATCH] =?UTF-8?q?Monitoring=20temp=C3=A9rature=20disques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services.nix b/services.nix index 1e920ef..a40d926 100644 --- a/services.nix +++ b/services.nix @@ -63,6 +63,9 @@ in system = {}; disk = {}; ipmi_sensor = { path = "${pkgs.ipmitool}/bin/ipmitool"; }; + smart = { + path = "${pkgs.writeShellScriptBin "smartctl" "/run/wrappers/bin/sudo ${pkgs.smartmontools}/bin/smartctl $@"}/bin/smartctl"; + }; }; outputs = { influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; }; @@ -73,6 +76,10 @@ in KERNEL=="ipmi*", MODE="660", OWNER="telegraf" ''; + security.sudo.extraRules = [ + { commands = [ { command = "${pkgs.smartmontools}/bin/smartctl"; options = [ "NOPASSWD" ]; } ]; users = [ "telegraf" ]; } + ]; + services.grafana.enable = true; services.grafana.addr = "127.0.0.1"; services.grafana.dataDir = "/var/lib/grafana";