Page 1 of 1

Return code of 127 for check of service check LDAP

Posted: Thu Jan 07, 2016 7:38 pm
by devnully
Hi,

I'm trying to monitor our LDAp & AD servers using /usr/local/nagios/libexec/check_ldap.

OS: Linux 2.6.32-504.3.3.el6.x86_64 #1 SMP Fri Dec 12 16:05:43 EST 2014 x86_64 x86_64 x86_64 GNU/Linux

Nagios Version: Nagios XI 5.2.3

./check_ldap -V
check_ldap v2.0.3 (nagios-plugins 2.0.3)

Permissions on file:
[root@myhost libexec]# ls -l check_ldap
-rwxrwxr-x 1 apache nagios 157786 Jan 12 2015 check_ldap

Using the CLI:
[nagios@myhost libexec]$ ./check_ldap -H AD-Host1 -b "dc=ad,dc=home" -D "AD-User" -P "AD-user-password" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.270 seconds response time|time=0.270271s;;1.000000;0.000000
[nagios@myhost libexec]$ ./check_ldap -H AD-Host2 -b "dc=ad,dc=home" -D "AD-User" -P "AD-user-password" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.007 seconds response time|time=0.007381s;;1.000000;0.000000
[nagios@myhost libexec]$ ./check_ldap -H AD-Host3 -b "dc=ad,dc=home" -D "AD-User" -P "AD-user-password" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.008 seconds response time|time=0.008099s;;1.000000;0.000000
[nagios@myhost libexec]$ ./check_ldap -H AD-Host4 -b "dc=ad,dc=home" -D "AD-User" -P "AD-user-password" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.023 seconds response time|time=0.023384s;;1.000000;0.000000

or to check out LDAP server:
[nagios@myhost libexec]$ ./check_ldap -H ldap1 -b "dc=home,dc=priv,dc=au" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.025 seconds response time|time=0.025384s;;1.000000;0.000000
[nagios@myhost libexec]$ ./check_ldap -H ldap2 -b "dc=home,dc=priv,dc=au" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.014 seconds response time|time=0.014159s;;1.000000;0.000000

This locks to me as if it is working.
However, in the nagios.log file and the GUI I see the following:
[1452211915] Warning: Return code of 127 for check of service 'check Active Directory' on host 'AD-Host1.ad.home' was out of bounds. Make sure the plugin you're trying to run actually exists.

I have tried:
nagios1.JPG
and
nagios2.JPG
to no avail.

Any help would be appreciated.

Cheers,
hw

Re: Return code of 127 for check of service check LDAP

Posted: Fri Jan 08, 2016 11:49 am
by rkennedy
The commands look fine - I wonder if the $HOSTADDRESS$ variable is creating an issue. Can you navigate to the CCM -> ### Hosts -> Click the host for one of the services in question.

What is the address variable set to?

Re: Return code of 127 for check of service check LDAP

Posted: Mon Jan 11, 2016 5:57 pm
by devnully
Thanks for coming back to my request.

$HOSTADDRESS$ is set to 10.7.64.64

./check_ldap -H 10.7.64.64 -b -b "dc=ad,dc=home" -D "AD-User" -P "AD-user-password" -w 0.5 -c 1 -t 5 -3
LDAP OK - 0.112 seconds response time|time=0.111794s;;1.000000;0.000000

Cheers,
hw

Re: Return code of 127 for check of service check LDAP

Posted: Tue Jan 12, 2016 11:35 am
by rkennedy
I had a whole different message typed out, and then it came to me. I think I see the issue.

Can you take a look at the command definition that you are using for check_ldap and change the command line part? $USER$ should be $USER1$

Make that change, and it should fix things. Let us know if it works.

Re: Return code of 127 for check of service check LDAP

Posted: Tue Jan 12, 2016 6:10 pm
by devnully
YES !

That fixed it. Thanks. I must have been thinking about GLUEHWEIN and other assorted Christmas goodies.

Again thanks for the help.

Cheers,
hw

Re: Return code of 127 for check of service check LDAP

Posted: Wed Jan 13, 2016 10:45 am
by hsmith
I'll go ahead and close this one. Thanks for letting us know it worked.