#!/bin/sh
#
#
# Univention Nagios Plugin
#  check_univention_ldap: check ldap status
#
# SPDX-FileCopyrightText: 2007-2025 Univention GmbH
# SPDX-License-Identifier: AGPL-3.0-only
#
#
eval "$(/usr/sbin/univention-config-registry shell hostname domainname ldap/base ldap/hostdn slapd/port)"
slapd_port="$(echo "$slapd_port"|LC_ALL=C cut -d, -f1)"
export LDAP_PASSWORD="$(cat /etc/machine.secret)"
exec /usr/lib/nagios/plugins/check_ldap -H "$hostname.$domainname" -p "$slapd_port" -b "$ldap_base" -D "$ldap_hostdn"
