]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/objects_quatresaisons.nix
Add monitoring for quatresaisons
[perso/Immae/Config/Nix.git] / modules / private / monitoring / objects_quatresaisons.nix
index 55d563120d11f9ce19d23e0152f493e5bc7f4ff1..f30cf81f49579196370dc87838ad0c85d036b04f 100644 (file)
@@ -1,4 +1,4 @@
-{ lib, hostFQDN, emailCheck, ... }:
+{ lib, hostFQDN, emailCheck, openldap, ... }:
 let
   defaultPassiveInfo = {
     filter = lib.attrsets.filterAttrs
@@ -11,7 +11,10 @@ let
   };
 in
 {
-  activatedPlugins = [ "megaraid" ];
+  resources = {
+    USER212 = "{{ .monitoring.quatresaisons.naemon_ldap }}";
+  };
+  activatedPlugins = [ "megaraid" "command" "postgresql" ];
   service = [
     {
       passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
@@ -19,5 +22,17 @@ in
       use = "local-service";
       check_command = ["check_megaraid"];
     }
+    {
+      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
+      service_description = "LDAP is running";
+      use = "local-service";
+      check_command = [ "check_command_status" "${openldap}/bin/ldapwhoami -D uid=naemon,ou=services,dc=salle-s,dc=org -w $USER212$" "0" ""];
+    }
+    {
+      passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-resources"; };
+      service_description = "Postgresql is running";
+      use = "local-service";
+      check_command = [ "check_postgresql_database_count" "/run/postgresql" "5432" "3" ];
+    }
   ];
 }