]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Small adjustments for naemon and web server
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 1 May 2021 17:05:47 +0000 (19:05 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 1 May 2021 17:05:47 +0000 (19:05 +0200)
environments/immae-eu.nix
modules/private/monitoring/default.nix
modules/private/monitoring/objects_master.nix
modules/private/monitoring/objects_tiboqorl-fr.nix
modules/private/websites/tools/tools/default.nix
modules/private/websites/tools/tools/dmarc_reports/api.php

index a398359761a13d319b087a0f2e686f58746e748e..7a52a28b24886ac51a67ae569369ccb9931f101e 100644 (file)
@@ -65,7 +65,7 @@ let
     newsboat irssi
 
     # nix
-    yarn2nix-moretea.yarn2nix nix
+    yarn2nix-moretea.yarn2nix nixUnstable
     nixops nix-prefetch-scripts nix-generate-from-cpan
     bundix nodePackages.bower2nix nix-diff
     nodePackages.node2nix niv
index d593e5503842b2067f394bdad4cdd8bcfab3b9b0..5f8a8c9a40099ccacd43ef04f8d871437b33e3fe 100644 (file)
@@ -232,7 +232,32 @@ in
 
   config = lib.mkIf cfg.enable {
     services.nginx = lib.mkIf config.myServices.status.enable {
-      virtualHosts."status.immae.eu".locations = objectsFiles;
+      virtualHosts."status.immae.eu".locations = objectsFiles // {
+        "=/common/immae.cfg" = {
+          alias = pkgs.writeText "immae.cfg" ''
+            # put me for instance in /etc/naemon/module-conf.d/immae.cfg
+            # Make sure that you have include_dir=module-conf.d in
+            # naemon.cfg
+            log_initial_states=1
+            date_format=iso8601
+            admin_email=${config.myEnv.monitoring.email}
+            obsess_over_services=1
+            ocsp_command=notify-master
+          '';
+        };
+        "=/common/resource.cfg" = {
+          alias = pkgs.writeText "resource.cfg" ''
+            # Resource.cfg file
+            # Replace this with path to monitoring plugins
+            $USER1$=@@COMMON_PLUGINS@@
+            # Replace this with a path to scripts from
+            # https://git.immae.eu/cgit/perso/Immae/Config/Nix.git/tree/modules/private/monitoring/plugins
+            $USER2$=@@IMMAE_PLUGINS@@
+            $USER200$=https://status.immae.eu/
+            $USER201$=@@TOKEN@@
+          '';
+        };
+      };
     };
 
     services.duplyBackup.profiles.monitoring = {
index 5b5b15fba24157e94fef350907ad84e88c3f74bd..30bfe7320a0ddb9831ae9ac1f78248366cc678f7 100644 (file)
@@ -32,6 +32,7 @@
         retain_status_information = "1";
         retry_interval = "2";
         check_command = "check_passive";
+        _webstatus_namespace = "immae";
       };
     };
   };
index 3657c19dff804b2e0be48fde7751afbfddc33f21..b49a1d8e31651155706d25c9ae9a138ac898008a 100644 (file)
@@ -85,10 +85,10 @@ in
   ];
   command = {
     check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$";
-    check_local_procs = "/usr/bin/sudo $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$";
+    check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$";
     check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$";
     check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$";
-    check_local_bandwidth = "/usr/bin/sudo $USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$";
+    check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$";
     check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$";
     check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org";
 
index 7903ca55984a51d997d773510e30dbe154796e33..64642061f4c1681342e2513ff9f5dce0a9856533 100644 (file)
@@ -114,6 +114,7 @@ in {
       root         = "/var/lib/ftp/devtools.immae.eu";
       extraConfig  = [
         ''
+          Use Apaxy "/var/lib/ftp/devtools.immae.eu" "title"
           Timeout 600
           ProxyTimeout 600
           Header always set Content-Security-Policy-Report-Only "${config.myEnv.tools.csp_reports.policies.inline}"
index 5d4657edf17cdbaa4e5a7b2cc447b7f3ea92c6d2..850f9ce4994d7a24908ff8947abf757ffab7694c 100644 (file)
@@ -116,5 +116,7 @@ if (!isset($_GET['serial'])) {
   }
 }
 
+header("Content-Type: application/json");
+
 echo json_encode($response, JSON_PRETTY_PRINT);
 ?>