I'm getting a "Could not init startTLS at port 389" error from check_ldap when executed as a Nagios service check.
If I run the plugin from the shell, it's working fine:
Code: Select all
root@ext1:/etc# /usr/lib/nagios/plugins/check_ldap -H ext1.broda.in -b o=broda -D uid=abwrite,ou=users,ou=accounts,o=broda -P ***** -T
LDAP OK - 0.039 seconds response time|time=0.038542s;;;0.000000Code: Select all
root@ext1:~# grep ^[^#] /etc/ldap/ldap.conf
TLS_CACERT /etc/letsencrypt/live/broda.in/chain.pem
TLS_REQCERT hardCode: Select all
root@ext1:~# openssl x509 -in /etc/letsencrypt/live/broda.in/cert.pem -noout -subject -enddate
subject=CN = *.broda.in
notAfter=Jan 14 02:56:38 2021 GMTCode: Select all
root@ext1:~# ldapsearch -xvZZ -h ext1.broda.in -b o=broda | tail -2
ldap_initialize( ldap://ext1.broda.in )
filter: (objectclass=*)
requesting: All userApplication attributes
# numResponses: 67
# numEntries: 66Code: Select all
[1605214611.239488] [2048.1] [pid=8622] Done. Final output: '/usr/lib/nagios/plugins/check_ldap -H ext1.broda.in -b o=broda -D uid=abwrite,ou=users,ou=accounts,o=broda -P ***** -T'
[1605214611.239493] [2048.1] [pid=8622] **** END MACRO PROCESSING *************
[1605214611.257571] [016.2] [pid=8622] Processing check result for service 'LDAP' on host 'ext1.broda.org'
[1605214611.257613] [016.0] [pid=8622] ** Handling check result for service 'LDAP' on host 'ext1.broda.org' from 'Core Worker 8628'...
[1605214611.257621] [016.1] [pid=8622] HOST: ext1.broda.org, SERVICE: LDAP, CHECK TYPE: Active, OPTIONS: 1, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 2, OUTPUT: Could not init startTLS at
port 389!
[1605214611.257632] [016.2] [pid=8622] Parsing check output...
[1605214611.257638] [016.2] [pid=8622] Short Output: Could not init startTLS at port 389!Code: Select all
root@ext1:~# su -s /bin/bash nagios
nagios@ext1:/root$ cd
nagios@ext1:~$ echo $HOME
/var/lib/nagiosWhat's wrong here?