Skip to content
Snippets Groups Projects
Commit 7e6f876f authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Added new script for ldap_status check

parent 567b9056
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,33 @@ instanceName=""
proxyDomainName="login.elixir-czech.org"
</pre>
### ldap_status.sh
This script checks if the LDAP servers are accessible
* Requirements:
* library *ldap-utils*
<pre>
apt-get install ldap-utils
</pre>
* Attributes to be filled:
<pre>
# LDAP username
user=""
# LDAP password
password=""
# Base dn of LDAP tree
basedn=""
# eduPersonPrincipalName which will be searched
searchedIdentity=""
# List of LDPA hostnames separated by space
# Included ldap:// or ldaps://
hostnames=""
</pre>
## List of plugins
Plugins are located in /usr/lib/check_mk/plugins/
......
#!/bin/bash
# LDAP username
user=""
# LDAP password
password=""
# Base dn of LDAP tree
basedn=""
# eduPersonPrincipalName which will be searched
searchedIdentity=""
# List of LDPA hostnames separated by space
# Included ldap:// or ldaps://
hostnames=""
for hostname in $hostnames
do
if [[ -z $password ]]; then
ldapresult=$(ldapsearch -x -H $hostname -b $basedn "(eduPersonPrincipalNames=$searchedIdentity)" 2>&1)
else
ldapresult=$(ldapsearch -x -H $hostname -D $user -w $password -b $basedn "(eduPersonPrincipalNames=$searchedIdentity)" 2>&1)
fi
result=$?
if [[ $result == 0 ]]; then
echo "0 ldap_status-$hostname - OK"
else
echo "2 ldap_status-$hostname - $ldapresult"
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment