]}
'';
};
+ smartctl = {
+ commands = {
+ check_smartctl = "$USER2$/check_smartctl -i auto -d $ARG1$";
+ };
+ chunk = let
+ smartPlugin = pkgs.fetchurl {
+ url = "https://www.claudiokuenzler.com/monitoring-plugins/check_smart.pl";
+ sha256 = "sha256-gxGkzyycUl+I3WziKhOnZSoQjpqbPqjbunfUQxmeb7w=";
+ };
+ in ''
+ cp ${smartPlugin} $out/check_smartctl
+ chmod +x $out/check_smartctl
+ patchShebangs $out
+ substituteInPlace $out/check_smartctl --replace "/usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/local/sbin" "${pkgs.smartmontools}/bin"
+ substituteInPlace $out/check_smartctl --replace "sudo" "${sudo}"
+ '';
+
+ sudo = _: {
+ commands = [
+ { command = "${pkgs.smartmontools}/bin/smartctl *"; options = [ "NOPASSWD" ]; }
+ ];
+ runAs = "root";
+ };
+ };
mysql = {
commands = {
check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\"";