]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/default.nix
Add syden peertube website
[perso/Immae/Config/Nix.git] / modules / private / monitoring / default.nix
index a7013af68cc6f4d6aedf7fdae8014c511e7de262..0586567ec326034bb11d61f5f61d5e05c092780e 100644 (file)
@@ -11,6 +11,11 @@ let
       pkgs.mailutils
     ]}
     '';
+  postgresqlBinary = if config.myServices.databasesReplication.postgresql.enable
+    then config.myServices.databasesReplication.postgresql.mainPackage
+    else if config.myServices.databases.enable
+    then config.myServices.databases.postgresql.package
+    else pkgs.postgresql;
   myplugins = pkgs.runCommand "buildplugins" {
     buildInputs = [ pkgs.makeWrapper pkgs.perl ];
   } ''
@@ -28,7 +33,7 @@ let
       pkgs.gnugrep pkgs.gawk pkgs.procps-ng
     ]}
     wrapProgram $out/check_postgres_replication --prefix PATH : ${lib.makeBinPath [
-      pkgs.postgresql
+      postgresqlBinary
     ]}
     wrapProgram $out/check_redis_replication --prefix PATH : ${lib.makeBinPath [
       pkgs.gnugrep pkgs.coreutils pkgs.redis
@@ -65,6 +70,9 @@ let
     wrapProgram $out/notify_by_slack --prefix PATH : ${lib.makeBinPath [
       pkgs.curl pkgs.jq
     ]}
+    wrapProgram $out/check_ovh_sms --prefix PATH : ${lib.makeBinPath [
+      (pkgs.python3.withPackages (ps: [ps.ovh]))
+    ]}
     '';
   toObjects = pkgs.callPackage ./to_objects.nix {};
   commonConfig = {
@@ -119,7 +127,7 @@ let
     };
   otherObjects = map
     (n: (pkgs.callPackage (./. + "/objects_" + n + ".nix") { inherit emailCheck; }))
-    [ "caldance-1" "ulminfo-fr" "immae-eu" "phare" "tiboqorl-fr" ];
+    [ "caldance-1" "ulminfo-fr" "phare" "tiboqorl-fr" ];
   masterObjects = pkgs.callPackage ./objects_master.nix { inherit config; };
   commonObjects = pkgs.callPackage ./objects_common.nix ({
     master = cfg.master;
@@ -259,6 +267,13 @@ in
         $USER206$=${config.myEnv.monitoring.slack_channel}
         $USER207$=${config.myEnv.monitoring.slack_url}
         $USER208$=${builtins.concatStringsSep "," (map (builtins.concatStringsSep ":") config.myEnv.monitoring.eriomem_keys)}
+        $USER209$=${builtins.concatStringsSep "," [
+          config.myEnv.monitoring.ovh_sms.endpoint
+          config.myEnv.monitoring.ovh_sms.application_key
+          config.myEnv.monitoring.ovh_sms.application_secret
+          config.myEnv.monitoring.ovh_sms.consumer_key
+          config.myEnv.monitoring.ovh_sms.account
+        ]}
       '';
       objectDefs = toObjects commonObjects
         + toObjects hostObjects