Page 2 of 2

Re: check_ldap fails from inside Nagios

Posted: Wed Jul 06, 2016 2:20 pm
by highness
Here is the service definition:

Code: Select all

define service {
	host_name			<REDACTED>.example.com
	service_description		LDAP Bind
	use				xiwizard_nrpe_service
	check_command			check_ldaps!dc=example,dc=com!uid=nagios_monitor,ou=privls,dc=example,dc=com!NagMon123!"-p 636 -3 -T -v"!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		60
	notification_period		xi_timeperiod_24x7
	notifications_enabled		1
	contacts			nagiosadmin
	_xiwizard			linux-server
	register			1
	}
And here is the check_command I'm using:

Code: Select all

$USER1$/check_ldap -H $HOSTADDRESS$ -b $ARG1$ -D "$ARG2$" -P $ARG3$ $ARG4$

Re: check_ldap fails from inside Nagios

Posted: Wed Jul 06, 2016 2:38 pm
by rkennedy
Does it help if you put $ARG1$ in double quotes like you have done for $ARG2$? I'm wondering if that's throwing it off, and I have a feeling at this point it's something very minuscule throwing it off.

Also, another thing I noticed. The command you posted is using check_ldap and not check_ldaps like your commands are -

Code: Select all

/usr/local/nagios/libexec/check_ldaps -H ldap0001.example.com -p 636 -b "dc=example,dc=com" -D "uid=nagios_monitor,ou=privls,dc=example,dc=com" -P "supersecretpasswordgoeshere" -3
and your command definition you just posted -

Code: Select all

$USER1$/check_ldap -H $HOSTADDRESS$ -b $ARG1$ -D "$ARG2$" -P $ARG3$ $ARG4$
I believe it should be $USER1$/check_ldaps

Re: check_ldap fails from inside Nagios

Posted: Wed Jul 06, 2016 2:43 pm
by tgriep
Check the permissions of the /etc/openldap folder and also the /etc/openldap/ldap.conf file.
Make sure the permissions are setup like this for the openldap folder.

Code: Select all

drwxrwxr-x.   apache nagios   openldap
and for the ldap.conf file

Code: Select all

-rw-rw-r--    apache nagios   ldap.conf
I think the plugin tries to use that file and if it can't read it, it could fail.