Hope that helps someone else.
···
Did a bit of command line checking and
using
./check_ldap -v -H n000a451 -b ‘dc=xxxx,dc=xxxxxxxxx,dc=com’ -t 10 -p
636 -3
it fails with
ldap_bind: Can’t contact LDAP server (-1)
additional info: TLS: hostname does not match CN in peer certificate
Could not bind to the LDAP server
but
./check_ldap -v -H n000a451.xxxx.xxxxxxxx.com -b ‘dc=xxxx,dc=xxxxxxxxx,dc=com’
-t 10 -p 636 -3
(i.e FQDN) works.
So the shortname passed from check_mk as the hostname will always fail,
unless I can get it to pass the FQDN (which check_mk does not know I don’t
think - unless I add a field)
So looks like a change needed in check_mk (to allow the WATO/GUI configuration
to do this, and potentially have the FQDN) and (nagios) check_ldap to get
this to work with new arguements 
Will look at other ways of doing this…probably a simpler check of some
kind.
Ben
From: Ben
Shade/UK/IBM@IBMGB
To: Darin
Perusich darin@darins.net
Cc: “checkmk-en@lists.mathias-kettner.de”
checkmk-en@lists.mathias-kettner.de
Date: 17/11/2016
10:06
Subject: Re:
[Check_mk (english)] check_mk_active-ldap with v3 startTLS - Could not
init startTLS at port 389!
Sent by: checkmk-en-bounces@lists.mathias-kettner.de
Thanks, this is not windows/AD but a Redhat openldap server (and in this
particular case a Redhat client) and I have proven startTLS works in multiple
way (ldapsearch including on the same check_mk/omd server, but I can’t
get check_mk_active-ldap to work (and suspect env variable is the issue).
I could try the LDAPTLS_REQCERT=allow (but don’t want to really leave this
on) but even to try it, I am not sure where the environment variable goes
so that check_mk_active-ldap will use it? (it is not needed for ldap search
as that works fine with startTLS)
Any ideas?
Ta
Ben
From: Darin
Perusich darin@darins.net
To: Ben
Shade/UK/IBM@IBMGB
Cc: “checkmk-en@lists.mathias-kettner.de”
checkmk-en@lists.mathias-kettner.de
Date: 16/11/2016
17:01
Subject: Re:
[Check_mk (english)] check_mk_active-ldap with v3 startTLS - Could not
init startTLS at port 389!
`
AD doesn’t support STARTTLS so you need to use LDAPS directly.
You can get around the certificate by setting the environment variable
LDAPTLS_REQCERT=allow, which will cause ldapsearch to ignore a “bad”
certificate. See ldap.conf man page for details.
–
Later,
Darin
On Wed, Nov 16, 2016 at 9:16 AM, Ben Shade benjamin_shade@uk.ibm.com wrote:
Have some new ldap servers running v3 and startTLS.
The ldapsearch command outside of check_mk works fine e.g.
ldapsearch -LL -v -D “cn=Manager,dc=xxxx,dc=xxxxx,dc=com”
-p 389 -h
n000a451.ixxxx.xxxxx.com -b “dc=xxxx,dc=xxxxxxxx,dc=com”
-s sub -x -ZZ
“(objectclass=*)” -v -W
ldap_initialize( ldap://n000a451.xxxx.xxxxxxx.com:389 )
Enter LDAP Password:
filter: (objectclass=*)
requesting: All userApplication attributes
version: 1
but inside check_mk it fails
check_mk_active-ldap! -b ‘dc=xxxx,dc=xxxxxx,dc=com’ -t 10 -D
‘cn=Manager,dc=xxxx,dc=xxxxxx,dc=com’ -p 389 -3 -T
gives
Could not init startTLS at port 389!
Now my investigation shows this is probably due to a certificate issue
but
only within check_mk. the ca certs are setup (as shown by the ldapsearch
command working).
I think check_mk_active-ldap can’t find the /etc/openldap/cert dir
or
/etc/openldap/ldap.conf file, probably due to an environment variable
being
‘missing’
I am using OMD 1.30 (rather then straight check_mk).
Any suggestions what and how to put in to make it see the right environment.
Maybe a bit like this guy did for nagios/icinga
([https://nagios-plugins.org/archive/help/2011-September/006241.html`]([Nagiosplug-help] check_ldap tls negotiation failed but only inside Nagios)`)
but for
check_mk?
Not sure what I need to change here.
Thanks
Ben
For ICDS, AICS, DST, project, infrastructure, consultancy or cloud
support
please use the ICDS Task ID : 3ADMTECH@uk.ibm.com
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with
number
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
[http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en`](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU`_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de`
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU`_______________________________________________
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
[http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en`](http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en)
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU