Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
There is an error in the sript which isn’t able to use an authenticated connection. If USER (-u) and PASS (-p) are provided, they aren’t used in the ldapsearch generated command and the connection is still anonymous.
Suggestion the LDAP query should be modified as follow:
# do the ldap query if [ “${USER}” = “” ]; then # maybe you need the -Z here if you have the simple authentication deactivated ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b “” -s base ${LDAPATTR} >${TMPFILE} 2>${ERRFILE} EXITCODE=$? else # maybe you need the -Z here if you have the simple authentication deactivated ldapsearch -H ${TYPE}://${HOST}:${PORT} -x -b “” -s base ${LDAPATTR} -D ${USER} -w ${PASS} >${TMPFILE} 2>${ERRFILE} EXITCODE=$? fi
Best regards Jean-Marc