]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/myplugins.nix
Add monitoring for quatresaisons
[perso/Immae/Config/Nix.git] / modules / private / monitoring / myplugins.nix
index 8c77ee77d3618ac8f88f076ffb9394116aa76b5a..86b5f1ec29449e5d1d5271e1dfe00368a77735b4 100644 (file)
@@ -310,6 +310,7 @@ in
   postgresql = {
     commands = {
       check_postgresql_replication = "${sudo} -u postgres $USER2$/check_postgres_replication \"$ARG1$\" \"$ARG2$\" \"$ARG3$\"";
+      check_postgresql_database_count = "$USER2$/check_postgres_database_count \"$ARG1$\" \"$ARG2$\" \"$ARG3$\"";
     };
     chunk = let
       postgresqlBinary = if config.myServices.databasesReplication.postgresql.enable
@@ -323,6 +324,11 @@ in
       wrapProgram $out/check_postgres_replication --prefix PATH : ${lib.makeBinPath [
         postgresqlBinary
       ]}
+      cp ${./plugins}/check_postgres_database_count $out/
+      patchShebangs $out/check_postgres_database_count
+      wrapProgram $out/check_postgres_database_count --prefix PATH : ${lib.makeBinPath [
+        postgresqlBinary
+      ]}
     '';
 
     sudo = myplugins: {