diff options
Diffstat (limited to 'flakes/private')
-rw-r--r-- | flakes/private/monitoring/myplugins.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/flakes/private/monitoring/myplugins.nix b/flakes/private/monitoring/myplugins.nix index f76f2c1..bb3a383 100644 --- a/flakes/private/monitoring/myplugins.nix +++ b/flakes/private/monitoring/myplugins.nix | |||
@@ -284,6 +284,30 @@ in | |||
284 | ]} | 284 | ]} |
285 | ''; | 285 | ''; |
286 | }; | 286 | }; |
287 | smartctl = { | ||
288 | commands = { | ||
289 | check_smartctl = "$USER2$/check_smartctl -i auto -d $ARG1$"; | ||
290 | }; | ||
291 | chunk = let | ||
292 | smartPlugin = pkgs.fetchurl { | ||
293 | url = "https://www.claudiokuenzler.com/monitoring-plugins/check_smart.pl"; | ||
294 | sha256 = "sha256-gxGkzyycUl+I3WziKhOnZSoQjpqbPqjbunfUQxmeb7w="; | ||
295 | }; | ||
296 | in '' | ||
297 | cp ${smartPlugin} $out/check_smartctl | ||
298 | chmod +x $out/check_smartctl | ||
299 | patchShebangs $out | ||
300 | substituteInPlace $out/check_smartctl --replace "/usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/local/sbin" "${pkgs.smartmontools}/bin" | ||
301 | substituteInPlace $out/check_smartctl --replace "sudo" "${sudo}" | ||
302 | ''; | ||
303 | |||
304 | sudo = _: { | ||
305 | commands = [ | ||
306 | { command = "${pkgs.smartmontools}/bin/smartctl *"; options = [ "NOPASSWD" ]; } | ||
307 | ]; | ||
308 | runAs = "root"; | ||
309 | }; | ||
310 | }; | ||
287 | mysql = { | 311 | mysql = { |
288 | commands = { | 312 | commands = { |
289 | check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\""; | 313 | check_mysql_replication = "${sudo} -u mysql $USER2$/check_mysql_replication \"$ARG1$\" \"$ARG2$\""; |