diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-06-18 06:47:08 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-06-18 06:47:08 +0200 |
commit | 171d8e1a8861e5844f6cb8d1623b93b0e86aabea (patch) | |
tree | 67c4d21e885e9a7b863329c6ed29742c7b490f4d /modules/private/monitoring/default.nix | |
parent | a97118c489a59d723538292214efaa10dfcb96df (diff) | |
download | Nix-171d8e1a8861e5844f6cb8d1623b93b0e86aabea.tar.gz Nix-171d8e1a8861e5844f6cb8d1623b93b0e86aabea.tar.zst Nix-171d8e1a8861e5844f6cb8d1623b93b0e86aabea.zip |
Add monitoring for duply backup
Diffstat (limited to 'modules/private/monitoring/default.nix')
-rw-r--r-- | modules/private/monitoring/default.nix | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix index 8ae0b30..316c2dd 100644 --- a/modules/private/monitoring/default.nix +++ b/modules/private/monitoring/default.nix | |||
@@ -58,6 +58,9 @@ let | |||
58 | wrapProgram $out/check_eriomem --prefix PATH : ${lib.makeBinPath [ | 58 | wrapProgram $out/check_eriomem --prefix PATH : ${lib.makeBinPath [ |
59 | pkgs.s3cmd pkgs.python3 | 59 | pkgs.s3cmd pkgs.python3 |
60 | ]} | 60 | ]} |
61 | wrapProgram $out/check_eriomem_age --prefix PATH : ${lib.makeBinPath [ | ||
62 | pkgs.duplicity | ||
63 | ]} --set SECRETS_PATH ${lib.optionalString cfg.master config.secrets.fullPaths."eriomem_access_key"} | ||
61 | wrapProgram $out/notify_by_email --prefix PATH : ${lib.makeBinPath [ | 64 | wrapProgram $out/notify_by_email --prefix PATH : ${lib.makeBinPath [ |
62 | pkgs.mailutils | 65 | pkgs.mailutils |
63 | ]} | 66 | ]} |
@@ -136,7 +139,7 @@ let | |||
136 | lib.attrsets.optionalAttrs | 139 | lib.attrsets.optionalAttrs |
137 | (builtins.pathExists specific_file) | 140 | (builtins.pathExists specific_file) |
138 | (pkgs.callPackage specific_file { | 141 | (pkgs.callPackage specific_file { |
139 | inherit config emailCheck; | 142 | inherit config nodes emailCheck; |
140 | hostFQDN = config.hostEnv.fqdn; | 143 | hostFQDN = config.hostEnv.fqdn; |
141 | hostName = name; | 144 | hostName = name; |
142 | }); | 145 | }); |
@@ -232,10 +235,22 @@ in | |||
232 | dest = "naemon/id_rsa"; | 235 | dest = "naemon/id_rsa"; |
233 | user = "naemon"; | 236 | user = "naemon"; |
234 | group = "naemon"; | 237 | group = "naemon"; |
235 | premissions = "0400"; | 238 | permissions = "0400"; |
236 | text = config.myEnv.monitoring.ssh_secret_key; | 239 | text = config.myEnv.monitoring.ssh_secret_key; |
237 | } | 240 | } |
238 | ]; | 241 | ] ++ lib.optional cfg.master ( |
242 | { | ||
243 | dest = "eriomem_access_key"; | ||
244 | user = "naemon"; | ||
245 | group = "naemon"; | ||
246 | permissions = "0400"; | ||
247 | text = '' | ||
248 | export AWS_ACCESS_KEY_ID="${config.myEnv.backup.accessKeyId}" | ||
249 | export AWS_SECRET_ACCESS_KEY="${config.myEnv.backup.secretAccessKey}" | ||
250 | export BASE_URL="${config.myEnv.backup.remote}" | ||
251 | ''; | ||
252 | } | ||
253 | ); | ||
239 | # needed since extraResource is not in the closure | 254 | # needed since extraResource is not in the closure |
240 | systemd.services.naemon.path = [ myplugins ]; | 255 | systemd.services.naemon.path = [ myplugins ]; |
241 | services.naemon = { | 256 | services.naemon = { |