diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-05-01 19:05:47 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-05-01 19:05:47 +0200 |
commit | a0e80453478719b9b13240f0e045d4d0419b8109 (patch) | |
tree | d5f4d2eda2702647c683e186fa73aaa01ee9f3ee | |
parent | 87949cb97f78dad19743352a584af432a4800e03 (diff) | |
download | Nix-a0e80453478719b9b13240f0e045d4d0419b8109.tar.gz Nix-a0e80453478719b9b13240f0e045d4d0419b8109.tar.zst Nix-a0e80453478719b9b13240f0e045d4d0419b8109.zip |
Small adjustments for naemon and web server
-rw-r--r-- | environments/immae-eu.nix | 2 | ||||
-rw-r--r-- | modules/private/monitoring/default.nix | 27 | ||||
-rw-r--r-- | modules/private/monitoring/objects_master.nix | 1 | ||||
-rw-r--r-- | modules/private/monitoring/objects_tiboqorl-fr.nix | 4 | ||||
-rw-r--r-- | modules/private/websites/tools/tools/default.nix | 1 | ||||
-rw-r--r-- | modules/private/websites/tools/tools/dmarc_reports/api.php | 2 |
6 files changed, 33 insertions, 4 deletions
diff --git a/environments/immae-eu.nix b/environments/immae-eu.nix index a398359..7a52a28 100644 --- a/environments/immae-eu.nix +++ b/environments/immae-eu.nix | |||
@@ -65,7 +65,7 @@ let | |||
65 | newsboat irssi | 65 | newsboat irssi |
66 | 66 | ||
67 | # nix | 67 | # nix |
68 | yarn2nix-moretea.yarn2nix nix | 68 | yarn2nix-moretea.yarn2nix nixUnstable |
69 | nixops nix-prefetch-scripts nix-generate-from-cpan | 69 | nixops nix-prefetch-scripts nix-generate-from-cpan |
70 | bundix nodePackages.bower2nix nix-diff | 70 | bundix nodePackages.bower2nix nix-diff |
71 | nodePackages.node2nix niv | 71 | nodePackages.node2nix niv |
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 | ||
119 | header("Content-Type: application/json"); | ||
120 | |||
119 | echo json_encode($response, JSON_PRETTY_PRINT); | 121 | echo json_encode($response, JSON_PRETTY_PRINT); |
120 | ?> | 122 | ?> |