diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 17:08:32 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 17:08:32 +0100 |
commit | e820134d38c3b7470ea5112f40a6dc967f039878 (patch) | |
tree | f05a5cefe285d060aa0ebf52829bcfcd35549f8b /modules/private/monitoring/objects_backup-2.nix | |
parent | b22ce4895ef1e9723a02061f7293e528cfbf9754 (diff) | |
download | Nix-e820134d38c3b7470ea5112f40a6dc967f039878.tar.gz Nix-e820134d38c3b7470ea5112f40a6dc967f039878.tar.zst Nix-e820134d38c3b7470ea5112f40a6dc967f039878.zip |
Add monitoring host
Diffstat (limited to 'modules/private/monitoring/objects_backup-2.nix')
-rw-r--r-- | modules/private/monitoring/objects_backup-2.nix | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/modules/private/monitoring/objects_backup-2.nix b/modules/private/monitoring/objects_backup-2.nix index 38b2ff6..52289dd 100644 --- a/modules/private/monitoring/objects_backup-2.nix +++ b/modules/private/monitoring/objects_backup-2.nix | |||
@@ -1,52 +1,73 @@ | |||
1 | { config, pkgs, ... }: | 1 | { config, pkgs, lib, hostFQDN, ... }: |
2 | let | ||
3 | defaultPassiveInfo = { | ||
4 | filter = lib.attrsets.filterAttrs | ||
5 | (k: v: builtins.elem k ["service_description"] || builtins.substring 0 1 k == "_"); | ||
6 | use = "external-passive-service"; | ||
7 | freshness_threshold = "450"; | ||
8 | retry_interval = "1"; | ||
9 | servicegroups = "webstatus-resources"; | ||
10 | host_name = hostFQDN; | ||
11 | }; | ||
12 | in | ||
2 | { | 13 | { |
3 | service = [ | 14 | service = [ |
4 | { | 15 | { |
16 | passiveInfo = defaultPassiveInfo; | ||
5 | service_description = "Size on /backup2 partition"; | 17 | service_description = "Size on /backup2 partition"; |
6 | use = "local-service"; | 18 | use = "local-service"; |
7 | check_command = ["check_local_disk" "10%" "5%" "/backup2"]; | 19 | check_command = ["check_local_disk" "10%" "5%" "/backup2"]; |
8 | } | 20 | } |
9 | { | 21 | { |
22 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; }; | ||
10 | service_description = "Last backup in /backup2/phare is not too old"; | 23 | service_description = "Last backup in /backup2/phare is not too old"; |
11 | use = "local-service"; | 24 | use = "local-service"; |
12 | check_command = ["check_last_file_date" "/backup2/phare" "14" "backup"]; | 25 | check_command = ["check_last_file_date" "/backup2/phare" "14" "backup"]; |
13 | } | 26 | } |
14 | { | 27 | { |
28 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; }; | ||
15 | service_description = "Last backup in /backup2/immae_eu is not too old"; | 29 | service_description = "Last backup in /backup2/immae_eu is not too old"; |
16 | use = "local-service"; | 30 | use = "local-service"; |
17 | check_command = ["check_last_file_date" "/backup2/immae_eu" "14" "backup"]; | 31 | check_command = ["check_last_file_date" "/backup2/immae_eu" "14" "backup"]; |
18 | } | 32 | } |
19 | { | 33 | { |
34 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; }; | ||
20 | service_description = "Last backup in /backup2/ulminfo is not too old"; | 35 | service_description = "Last backup in /backup2/ulminfo is not too old"; |
21 | use = "local-service"; | 36 | use = "local-service"; |
22 | check_command = ["check_last_file_date" "/backup2/ulminfo" "14" "backup"]; | 37 | check_command = ["check_last_file_date" "/backup2/ulminfo" "14" "backup"]; |
23 | } | 38 | } |
24 | { | 39 | { |
40 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; }; | ||
25 | service_description = "Last postgresql dump in /backup2/eldiron/postgresql_backup is not too old"; | 41 | service_description = "Last postgresql dump in /backup2/eldiron/postgresql_backup is not too old"; |
26 | use = "local-service"; | 42 | use = "local-service"; |
27 | check_command = ["check_last_file_date" "/backup2/eldiron/postgresql_backup" "7" "postgres"]; | 43 | check_command = ["check_last_file_date" "/backup2/eldiron/postgresql_backup" "7" "postgres"]; |
28 | } | 44 | } |
29 | { | 45 | { |
46 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; }; | ||
30 | service_description = "Redis replication for eldiron is up to date"; | 47 | service_description = "Redis replication for eldiron is up to date"; |
31 | use = "local-service"; | 48 | use = "local-service"; |
32 | check_command = ["check_redis_replication" "/run/redis_eldiron/redis.sock"]; | 49 | check_command = ["check_redis_replication" "/run/redis_eldiron/redis.sock"]; |
33 | } | 50 | } |
34 | { | 51 | { |
52 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; }; | ||
35 | service_description = "Last redis dump in /backup2/eldiron/redis_backup is not too old"; | 53 | service_description = "Last redis dump in /backup2/eldiron/redis_backup is not too old"; |
36 | use = "local-service"; | 54 | use = "local-service"; |
37 | check_command = ["check_last_file_date" "/backup2/eldiron/redis_backup" "7" "redis"]; | 55 | check_command = ["check_last_file_date" "/backup2/eldiron/redis_backup" "7" "redis"]; |
38 | } | 56 | } |
39 | { | 57 | { |
58 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; }; | ||
40 | service_description = "Mysql replication for eldiron is up to date"; | 59 | service_description = "Mysql replication for eldiron is up to date"; |
41 | use = "local-service"; | 60 | use = "local-service"; |
42 | check_command = ["check_mysql_replication" "/run/mysqld_eldiron/mysqld.sock" "/var/secrets/mysql_replication/eldiron/client"]; | 61 | check_command = ["check_mysql_replication" "/run/mysqld_eldiron/mysqld.sock" "/var/secrets/mysql_replication/eldiron/client"]; |
43 | } | 62 | } |
44 | { | 63 | { |
64 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; }; | ||
45 | service_description = "Last mysql dump in /backup2/eldiron/mysql_backup is not too old"; | 65 | service_description = "Last mysql dump in /backup2/eldiron/mysql_backup is not too old"; |
46 | use = "local-service"; | 66 | use = "local-service"; |
47 | check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"]; | 67 | check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"]; |
48 | } | 68 | } |
49 | { | 69 | { |
70 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; }; | ||
50 | service_description = "Openldap replication for eldiron is up to date"; | 71 | service_description = "Openldap replication for eldiron is up to date"; |
51 | use = "local-service"; | 72 | use = "local-service"; |
52 | check_command = let | 73 | check_command = let |
@@ -73,6 +94,7 @@ | |||
73 | ]; | 94 | ]; |
74 | } | 95 | } |
75 | { | 96 | { |
97 | passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; }; | ||
76 | service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old"; | 98 | service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old"; |
77 | use = "local-service"; | 99 | use = "local-service"; |
78 | check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"]; | 100 | check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"]; |