Return code of 127 for check of service check LDAP

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
devnully
Posts: 10
Joined: Mon Jan 12, 2015 4:33 pm

Return code of 127 for check of service check LDAP

Post 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
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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?
Former Nagios Employee
devnully
Posts: 10
Joined: Mon Jan 12, 2015 4:33 pm

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

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
devnully
Posts: 10
Joined: Mon Jan 12, 2015 4:33 pm

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

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

I'll go ahead and close this one. Thanks for letting us know it worked.
Former Nagios Employee.
me.
Locked