cookbook-zabbix/files/default/traps/scripts/openldap

15 lines
304 B
Text
Raw Permalink Normal View History

2017-02-07 01:02:03 -05:00
#!/bin/bash
search=$(ldapsearch -x -H ldapi:/// -b '' -s base '(objectClass=*)' namingConexts | grep -wc "Success")
if [[ $search -gt 0 ]]
then
echo "- ldap.search 1"
else
echo "- ldap.search 0"
fi
port=$(zabbix_agent -t net.tcp.port[,636] | cut -d'|' -f2 | cut -d']' -f1)
echo "- ldap.port $port"