Browse Source

icinga2: Add LDAP replication check.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
f8303aee6b
2 changed files with 27 additions and 0 deletions
  1. 14 0
      icinga2/commands.d/ldap.conf
  2. 13 0
      icinga2/services/ldap.conf

+ 14 - 0
icinga2/commands.d/ldap.conf

@@ -0,0 +1,14 @@
+#
+# Check LDAP replication
+object CheckCommand "ldap_replication" {
+	import "plugin-check-command"
+
+	command = [  "/usr/local/share/monitoring-plugins/check_ldap_replication" ]
+
+	arguments = {
+		"--master" = "$ldap_master$"
+		"--mirror" = "$ldap_mirror$"
+		"--bind-dn" = "$ldap_bind_dn$"
+		"--sync-base" = "$ldap_sync_base$"
+	}
+}

+ 13 - 0
icinga2/services/ldap.conf

@@ -15,3 +15,16 @@ apply Service "ldaps" {
 	assign where host.vars.ldap_fqdn && "ldap-master" in host.vars.roles
 	assign where host.vars.ldap_fqdn && "ldap-replica" in host.vars.roles
 }
+
+apply Service "ldap_replication" {
+        import "generic-service"
+
+	check_command = "ldap_replication"
+
+	vars.ldap_master = "ldaps://ldap-master.srv.in.ffho.net"
+	vars.ldap_mirror = "ldaps://" + host.vars.ldap_fqdn
+	vars.ldap_sync_base = "ou=sync-check,dc=ffho,dc=net"
+	vars.ldap_bind_dn = "uid=sync-check,ou=accounts,dc=ffho,dc=net"
+
+	assign where host.vars.ldap_fqdn && "ldap-replica" in host.vars.roles
+}