]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/monitoring/objects_quatresaisons.nix
Add monitoring for quatresaisons
[perso/Immae/Config/Nix.git] / modules / private / monitoring / objects_quatresaisons.nix
CommitLineData
e64a4968 1{ lib, hostFQDN, emailCheck, openldap, ... }:
6ee77836
IB
2let
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 };
12in
13{
e64a4968
IB
14 resources = {
15 USER212 = "{{ .monitoring.quatresaisons.naemon_ldap }}";
16 };
17 activatedPlugins = [ "megaraid" "command" "postgresql" ];
6ee77836 18 service = [
f7a3019f
IB
19 {
20 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
21 service_description = "No RAID device is degraded";
22 use = "local-service";
23 check_command = ["check_megaraid"];
24 }
e64a4968
IB
25 {
26 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
27 service_description = "LDAP is running";
28 use = "local-service";
29 check_command = [ "check_command_status" "${openldap}/bin/ldapwhoami -D uid=naemon,ou=services,dc=salle-s,dc=org -w $USER212$" "0" ""];
30 }
31 {
32 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
33 service_description = "Postgresql is running";
34 use = "local-service";
35 check_command = [ "check_postgresql_database_count" "/run/postgresql" "5432" "3" ];
36 }
6ee77836
IB
37 ];
38}