aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/private/environment.nix1
-rw-r--r--modules/private/monitoring/default.nix9
-rw-r--r--modules/private/monitoring/objects_common.nix14
-rw-r--r--modules/private/monitoring/objects_eban.nix10
-rw-r--r--modules/private/monitoring/objects_monitoring-1.nix2
-rw-r--r--modules/private/monitoring/objects_tiboqorl-fr.nix6
-rwxr-xr-xmodules/private/monitoring/plugins/notify_eban_url11
7 files changed, 28 insertions, 25 deletions
diff --git a/modules/private/environment.nix b/modules/private/environment.nix
index 91e018d..9cd591e 100644
--- a/modules/private/environment.nix
+++ b/modules/private/environment.nix
@@ -563,6 +563,7 @@ in
563 description = "Eban credentials for webhook"; 563 description = "Eban credentials for webhook";
564 type = submodule { 564 type = submodule {
565 options = { 565 options = {
566 user = mkOption { type = str; description = "User"; };
566 password = mkOption { type = str; description = "Password"; }; 567 password = mkOption { type = str; description = "Password"; };
567 }; 568 };
568 }; 569 };
diff --git a/modules/private/monitoring/default.nix b/modules/private/monitoring/default.nix
index 342c7f7..d593e55 100644
--- a/modules/private/monitoring/default.nix
+++ b/modules/private/monitoring/default.nix
@@ -109,12 +109,12 @@ let
109 commonConfig = { 109 commonConfig = {
110 dilion = { 110 dilion = {
111 processWarn = "250"; processAlert = "400"; 111 processWarn = "250"; processAlert = "400";
112 loadWarn = "8.0"; loadAlert = "10.0"; 112 loadWarn = "1.0"; loadAlert = "1.2";
113 interface = "eth0"; 113 interface = "eth0";
114 }; 114 };
115 eldiron = { 115 eldiron = {
116 processWarn = "250"; processAlert = "400"; 116 processWarn = "250"; processAlert = "400";
117 loadWarn = "8.0"; loadAlert = "10.0"; 117 loadWarn = "1.0"; loadAlert = "1.2";
118 interface = "eth0"; 118 interface = "eth0";
119 }; 119 };
120 backup-2 = { 120 backup-2 = {
@@ -130,7 +130,7 @@ let
130 }; 130 };
131 quatresaisons = { 131 quatresaisons = {
132 processWarn = "250"; processAlert = "400"; 132 processWarn = "250"; processAlert = "400";
133 loadWarn = "8.0"; loadAlert = "10.0"; 133 loadWarn = "1.0"; loadAlert = "1.2";
134 interface = "eth0"; 134 interface = "eth0";
135 }; 135 };
136 }; 136 };
@@ -347,7 +347,8 @@ in
347 config.myEnv.monitoring.ovh_sms.consumer_key 347 config.myEnv.monitoring.ovh_sms.consumer_key
348 config.myEnv.monitoring.ovh_sms.account 348 config.myEnv.monitoring.ovh_sms.account
349 ]} 349 ]}
350 $USER210$=${config.myEnv.monitoring.eban.password} 350 $USER210$=${config.myEnv.monitoring.eban.user}
351 $USER211$=${config.myEnv.monitoring.eban.password}
351 ''; 352 '';
352 objectDefs = toObjects commonObjects 353 objectDefs = toObjects commonObjects
353 + toObjects hostObjects 354 + toObjects hostObjects
diff --git a/modules/private/monitoring/objects_common.nix b/modules/private/monitoring/objects_common.nix
index ee158dc..10cc149 100644
--- a/modules/private/monitoring/objects_common.nix
+++ b/modules/private/monitoring/objects_common.nix
@@ -3,10 +3,10 @@
3, interface ? "eth0" 3, interface ? "eth0"
4, processWarn ? "250" 4, processWarn ? "250"
5, processAlert ? "400" 5, processAlert ? "400"
6, loadWarn ? "8.0" 6, loadWarn ? "0.9"
7, load5Warn ? loadWarn 7, load5Warn ? loadWarn
8, load15Warn ? load5Warn 8, load15Warn ? load5Warn
9, loadAlert ? "10.0" 9, loadAlert ? "1.0"
10, load5Alert ? loadAlert 10, load5Alert ? loadAlert
11, load15Alert ? load5Alert 11, load15Alert ? load5Alert
12, mdadm 12, mdadm
@@ -127,7 +127,7 @@ in
127 check_imap_connection = "$USER2$/check_imap_connection -u \"$USER204$\" -p \"$USER205$\" -H \"imap.immae.eu:143\""; 127 check_imap_connection = "$USER2$/check_imap_connection -u \"$USER204$\" -p \"$USER205$\" -H \"imap.immae.eu:143\"";
128 check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$"; 128 check_local_disk = "$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$";
129 check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$"; 129 check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$";
130 check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$"; 130 check_local_load = "$USER1$/check_load -r -w $ARG1$ -c $ARG2$";
131 check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$"; 131 check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$";
132 check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$"; 132 check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$";
133 check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$"; 133 check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$";
@@ -157,8 +157,8 @@ in
157 # $OVE is to force naemon to run via shell instead of execve which fails here 157 # $OVE is to force naemon to run via shell instead of execve which fails here
158 notify-service-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_email service \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE"; 158 notify-service-by-email = "ADMINEMAIL=\"$ADMINEMAIL$\" SERVICENOTIFICATIONID=\"$SERVICENOTIFICATIONID$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_email service \"$NOTIFICATIONTYPE$\" \"$HOSTALIAS$\" \"$LONGDATETIME$\" \"$CONTACTEMAIL$\" $OVE";
159 notify-by-slack = "HOST=\"$HOSTALIAS$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_slack \"$ARG1$\" \"$ARG2$\""; 159 notify-by-slack = "HOST=\"$HOSTALIAS$\" SERVICESTATE=\"$SERVICESTATE$\" SERVICEDESC=\"$SERVICEDESC$\" SERVICEOUTPUT=\"$SERVICEOUTPUT$\" $USER2$/notify_by_slack \"$ARG1$\" \"$ARG2$\"";
160 notify-host-eban-url = "STATUS_NAME=\"Server\" PASSWORD=\"$USER210$\" HOSTSTATE=\"$HOSTSTATE$\" $USER2$/notify_eban_url"; 160 notify-host-eban-url = "STATUS_NAME=\"Server\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" HOSTSTATE=\"$HOSTSTATE$\" $USER2$/notify_eban_url";
161 notify-service-eban-url = "STATUS_NAME=\"$_SERVICEWEBSTATUS_NAME$\" PASSWORD=\"$USER210$\" SERVICESTATE=\"$SERVICESTATE$\" $USER2$/notify_eban_url"; 161 notify-service-eban-url = "STATUS_NAME=\"$_SERVICEWEBSTATUS_NAME$\" USER=\"$USER210$\" PASSWORD=\"$USER211$\" SERVICESTATE=\"$SERVICESTATE$\" $USER2$/notify_eban_url";
162 162
163 notify-master = "$USER2$/send_nrdp.sh -u \"$USER200$\" -t \"$USER201$\" -H \"$HOSTADDRESS$\" -s \"$SERVICEDESC$\" -S \"$SERVICESTATEID$\" -o \"$SERVICEOUTPUT$ | $SERVICEPERFDATA$\""; 163 notify-master = "$USER2$/send_nrdp.sh -u \"$USER200$\" -t \"$USER201$\" -H \"$HOSTADDRESS$\" -s \"$SERVICEDESC$\" -S \"$SERVICESTATEID$\" -o \"$SERVICEOUTPUT$ | $SERVICEPERFDATA$\"";
164 }; 164 };
@@ -187,7 +187,7 @@ in
187 webstatus-backup = { alias = "Backup resources"; }; 187 webstatus-backup = { alias = "Backup resources"; };
188 }; 188 };
189 hostgroup = { 189 hostgroup = {
190 webstatus-hosts = { alias = "Hosts"; }; 190 webstatus-hosts = { alias = "Hosts"; };
191 }; 191 };
192 contactgroup = { 192 contactgroup = {
193 admins = { alias = "Naemon Administrators"; }; 193 admins = { alias = "Naemon Administrators"; };
@@ -214,6 +214,7 @@ in
214 retain_nonstatus_information = "1"; 214 retain_nonstatus_information = "1";
215 retain_status_information = "1"; 215 retain_status_information = "1";
216 retry_interval = "2"; 216 retry_interval = "2";
217 _webstatus_namespace = "immae";
217 }; 218 };
218 local-service = { 219 local-service = {
219 use = "generic-service"; 220 use = "generic-service";
@@ -285,6 +286,7 @@ in
285 notification_interval = "120"; 286 notification_interval = "120";
286 notification_options = "d,u,r,f"; 287 notification_options = "d,u,r,f";
287 retry_interval = "1"; 288 retry_interval = "1";
289 _webstatus_namespace = "immae";
288 }; 290 };
289 }; 291 };
290 }; 292 };
diff --git a/modules/private/monitoring/objects_eban.nix b/modules/private/monitoring/objects_eban.nix
index 659b0ec..9ad49e1 100644
--- a/modules/private/monitoring/objects_eban.nix
+++ b/modules/private/monitoring/objects_eban.nix
@@ -8,6 +8,7 @@ let
8 check_interval = "15"; 8 check_interval = "15";
9 9
10 servicegroups = "webstatus-resources"; 10 servicegroups = "webstatus-resources";
11 _webstatus_namespace = "eban";
11 } // rest; 12 } // rest;
12in 13in
13{ 14{
@@ -28,6 +29,7 @@ in
28 contact_groups = "null"; 29 contact_groups = "null";
29 _webstatus_name = "Eban"; 30 _webstatus_name = "Eban";
30 _webstatus_vhost = "status.eban.bzh"; 31 _webstatus_vhost = "status.eban.bzh";
32 _webstatus_namespace = "eban";
31 }; 33 };
32 }; 34 };
33 service = [ 35 service = [
@@ -50,11 +52,11 @@ in
50 _webstatus_url = "https://git.eban.bzh/"; 52 _webstatus_url = "https://git.eban.bzh/";
51 }) 53 })
52 (serviceTemplate { 54 (serviceTemplate {
53 service_description = "Eban Cloud is up and running"; 55 service_description = "Eban Bitwarden is up and running";
54 check_command = ["check_https" "cloud.eban.bzh" "/" "<title>"]; 56 check_command = ["check_https" "bitwarden.eban.bzh" "/" "<title"];
55 57
56 _webstatus_name = "Cloud"; 58 _webstatus_name = "Bitwarden";
57 _webstatus_url = "https://cloud.eban.bzh/"; 59 _webstatus_url = "https://bitwarden.eban.bzh/";
58 }) 60 })
59 ]; 61 ];
60} 62}
diff --git a/modules/private/monitoring/objects_monitoring-1.nix b/modules/private/monitoring/objects_monitoring-1.nix
index 9503da2..6432ddb 100644
--- a/modules/private/monitoring/objects_monitoring-1.nix
+++ b/modules/private/monitoring/objects_monitoring-1.nix
@@ -695,6 +695,7 @@ in
695 use = "external-web-service"; 695 use = "external-web-service";
696 contact_groups = "tiboqorl"; 696 contact_groups = "tiboqorl";
697 check_command = [ "check_https" "sc.groupe-cyllene.com" "/" "<title>Support Client Cyllene" ]; 697 check_command = [ "check_https" "sc.groupe-cyllene.com" "/" "<title>Support Client Cyllene" ];
698 _webstatus_namespace = "tiboqorl";
698 } 699 }
699 700
700 { 701 {
@@ -703,6 +704,7 @@ in
703 use = "external-web-service"; 704 use = "external-web-service";
704 contact_groups = "tiboqorl"; 705 contact_groups = "tiboqorl";
705 check_command = [ "check_https" "origny.tiboqorl.fr" "/" "<title>Home Assistant" ]; 706 check_command = [ "check_https" "origny.tiboqorl.fr" "/" "<title>Home Assistant" ];
707 _webstatus_namespace = "tiboqorl";
706 } 708 }
707 ] ++ to_resource to_backup_age nodes.eldiron.config.services.duplyBackup; 709 ] ++ to_resource to_backup_age nodes.eldiron.config.services.duplyBackup;
708 contact = { 710 contact = {
diff --git a/modules/private/monitoring/objects_tiboqorl-fr.nix b/modules/private/monitoring/objects_tiboqorl-fr.nix
index 77403ba..3657c19 100644
--- a/modules/private/monitoring/objects_tiboqorl-fr.nix
+++ b/modules/private/monitoring/objects_tiboqorl-fr.nix
@@ -10,6 +10,7 @@ let
10 notification_interval = "240"; 10 notification_interval = "240";
11 retry_interval = "1"; 11 retry_interval = "1";
12 servicegroups = "webstatus-resources"; 12 servicegroups = "webstatus-resources";
13 _webstatus_namespace = "tiboqorl";
13 host_name = hostFQDN; 14 host_name = hostFQDN;
14 }; 15 };
15in 16in
@@ -23,6 +24,7 @@ in
23 hostgroups = "webstatus-hosts"; 24 hostgroups = "webstatus-hosts";
24 _webstatus_name = "tiboqorl"; 25 _webstatus_name = "tiboqorl";
25 _webstatus_vhost = "status.immae.eu"; 26 _webstatus_vhost = "status.immae.eu";
27 _webstatus_namespace = "tiboqorl";
26 }; 28 };
27 }; 29 };
28 service = [ 30 service = [
@@ -58,8 +60,8 @@ in
58 use = "local-service"; 60 use = "local-service";
59 check_command = [ 61 check_command = [
60 "check_local_load" 62 "check_local_load"
61 "3.0,3.0,3.0" # warn 63 "0.75,0.75,0.75" # warn
62 "4.0,4.0,4.0" # alert 64 "1.0,1.0,1.0" # alert
63 ]; 65 ];
64 } 66 }
65 { 67 {
diff --git a/modules/private/monitoring/plugins/notify_eban_url b/modules/private/monitoring/plugins/notify_eban_url
index 431e320..107b5de 100755
--- a/modules/private/monitoring/plugins/notify_eban_url
+++ b/modules/private/monitoring/plugins/notify_eban_url
@@ -1,13 +1,6 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3PASS=$(echo "$PASSWORD" | base64 -d)
4
5if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then 3if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then
6 action=downAlert 4 MESSAGE="$STATUS_NAME seems down!"
7elif [ "$SERVICESTATE" = "OK" -o "$HOSTSTATE" = "UP" ]; then 5 curl -X GET -G --data-urlencode "user=$USER" --data-urlencode "pass=$PASSWORD" --data-urlencode "msg=$MESSAGE" https://smsapi.free-mobile.fr/sendmsg
8 action=upAlert
9fi
10
11if [ -n "$action" ]; then
12 curl -X GET -G --data-urlencode "service=$STATUS_NAME" --data-urlencode "mdp=$PASS" https://infra.eban.bzh/$action
13fi 6fi