aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2021-05-01 19:05:47 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2021-05-01 19:05:47 +0200
commita0e80453478719b9b13240f0e045d4d0419b8109 (patch)
treed5f4d2eda2702647c683e186fa73aaa01ee9f3ee /modules
parent87949cb97f78dad19743352a584af432a4800e03 (diff)
downloadNix-a0e80453478719b9b13240f0e045d4d0419b8109.tar.gz
Nix-a0e80453478719b9b13240f0e045d4d0419b8109.tar.zst
Nix-a0e80453478719b9b13240f0e045d4d0419b8109.zip
Small adjustments for naemon and web server
Diffstat (limited to 'modules')
-rw-r--r--modules/private/monitoring/default.nix27
-rw-r--r--modules/private/monitoring/objects_master.nix1
-rw-r--r--modules/private/monitoring/objects_tiboqorl-fr.nix4
-rw-r--r--modules/private/websites/tools/tools/default.nix1
-rw-r--r--modules/private/websites/tools/tools/dmarc_reports/api.php2
5 files changed, 32 insertions, 3 deletions
diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix
index d593e55..5f8a8c9 100644
--- a/modules/private/monitoring/default.nix
+++ b/modules/private/monitoring/default.nix
@@ -232,7 +232,32 @@ in
232 232
233 config = lib.mkIf cfg.enable { 233 config = lib.mkIf cfg.enable {
234 services.nginx = lib.mkIf config.myServices.status.enable { 234 services.nginx = lib.mkIf config.myServices.status.enable {
235 virtualHosts."status.immae.eu".locations = objectsFiles; 235 virtualHosts."status.immae.eu".locations = objectsFiles // {
236 "=/common/immae.cfg" = {
237 alias = pkgs.writeText "immae.cfg" ''
238 # put me for instance in /etc/naemon/module-conf.d/immae.cfg
239 # Make sure that you have include_dir=module-conf.d in
240 # naemon.cfg
241 log_initial_states=1
242 date_format=iso8601
243 admin_email=${config.myEnv.monitoring.email}
244 obsess_over_services=1
245 ocsp_command=notify-master
246 '';
247 };
248 "=/common/resource.cfg" = {
249 alias = pkgs.writeText "resource.cfg" ''
250 # Resource.cfg file
251 # Replace this with path to monitoring plugins
252 $USER1$=@@COMMON_PLUGINS@@
253 # Replace this with a path to scripts from
254 # https://git.immae.eu/cgit/perso/Immae/Config/Nix.git/tree/modules/private/monitoring/plugins
255 $USER2$=@@IMMAE_PLUGINS@@
256 $USER200$=https://status.immae.eu/
257 $USER201$=@@TOKEN@@
258 '';
259 };
260 };
236 }; 261 };
237 262
238 services.duplyBackup.profiles.monitoring = { 263 services.duplyBackup.profiles.monitoring = {
diff --git a/modules/private/monitoring/objects_master.nix b/modules/private/monitoring/objects_master.nix
index 5b5b15f..30bfe73 100644
--- a/modules/private/monitoring/objects_master.nix
+++ b/modules/private/monitoring/objects_master.nix
@@ -32,6 +32,7 @@
32 retain_status_information = "1"; 32 retain_status_information = "1";
33 retry_interval = "2"; 33 retry_interval = "2";
34 check_command = "check_passive"; 34 check_command = "check_passive";
35 _webstatus_namespace = "immae";
35 }; 36 };
36 }; 37 };
37 }; 38 };
diff --git a/modules/private/monitoring/objects_tiboqorl-fr.nix b/modules/private/monitoring/objects_tiboqorl-fr.nix
index 3657c19..b49a1d8 100644
--- a/modules/private/monitoring/objects_tiboqorl-fr.nix
+++ b/modules/private/monitoring/objects_tiboqorl-fr.nix
@@ -85,10 +85,10 @@ in
85 ]; 85 ];
86 command = { 86 command = {
87 check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$"; 87 check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$";
88 check_local_procs = "/usr/bin/sudo $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$"; 88 check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$";
89 check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$"; 89 check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$";
90 check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$"; 90 check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$";
91 check_local_bandwidth = "/usr/bin/sudo $USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$"; 91 check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$";
92 check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$"; 92 check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$";
93 check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org"; 93 check_ntp = "$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org";
94 94
diff --git a/modules/private/websites/tools/tools/default.nix b/modules/private/websites/tools/tools/default.nix
index 7903ca5..6464206 100644
--- a/modules/private/websites/tools/tools/default.nix
+++ b/modules/private/websites/tools/tools/default.nix
@@ -114,6 +114,7 @@ in {
114 root = "/var/lib/ftp/devtools.immae.eu"; 114 root = "/var/lib/ftp/devtools.immae.eu";
115 extraConfig = [ 115 extraConfig = [
116 '' 116 ''
117 Use Apaxy "/var/lib/ftp/devtools.immae.eu" "title"
117 Timeout 600 118 Timeout 600
118 ProxyTimeout 600 119 ProxyTimeout 600
119 Header always set Content-Security-Policy-Report-Only "${config.myEnv.tools.csp_reports.policies.inline}" 120 Header always set Content-Security-Policy-Report-Only "${config.myEnv.tools.csp_reports.policies.inline}"
diff --git a/modules/private/websites/tools/tools/dmarc_reports/api.php b/modules/private/websites/tools/tools/dmarc_reports/api.php
index 5d4657e..850f9ce 100644
--- a/modules/private/websites/tools/tools/dmarc_reports/api.php
+++ b/modules/private/websites/tools/tools/dmarc_reports/api.php
@@ -116,5 +116,7 @@ if (!isset($_GET['serial'])) {
116 } 116 }
117} 117}
118 118
119header("Content-Type: application/json");
120
119echo json_encode($response, JSON_PRETTY_PRINT); 121echo json_encode($response, JSON_PRETTY_PRINT);
120?> 122?>