Run Check Command versus Service Status Detail

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Run Check Command versus Service Status Detail

Post by onegative »

G 'Day Nagios Support,

So I am having a problem where a particular check_ldap Service.

I can run the command via the command line and it works as expected.

Code: Select all

[nagios@dcom-nagiosxi-p2 ~]$ /usr/local/nagios/libexec/check_ldap -H nwh-dc-03.nwhsea.org -b "dc=nwhsea,dc=org" -D "myUserName" -P "somePassword" -3 -S  -w 10 -c 20
LDAP OK - 0.072 seconds response time|time=0.071884s;10.000000;20.000000;0.000000
I can 'Run Check Command' from Service Management successfully as the screen shot indicates.
Run Check Command.png
But from the actual Service Check within Nagios XI it is failing as the screen shot shows.
Service Status Detail.png
I am just unsure what the disconnect is, can you make any suggestions why this might be happening?

And as always thanks in advance,
Danny
@onegative
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Run Check Command versus Service Status Detail

Post by dchurch »

$USER5$ and $USER6 are not expanding in the Run Check Command dialog, instead where the variable's value is supposed to be subbed in, it's a literal string, i.e.

Code: Select all

/usr/local/nagios/libexec/check_ldap -H example.com -b "dc=nwhsea,dc=org" -D '$USER5$' -P '$USER6' -3 -S  -w 10 -c 20
When the check is run "for real" by the monitoring engine (not the Run Check Command dialog) the values are subbed in differently, instead of inserting the literal string it's inserting (for me) nothing at all.

Where do the $USER5$ and $USER6 come from? Where are they set?
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: Run Check Command versus Service Status Detail

Post by onegative »

They are standard User Macros defined in /usr/local/nagios/etc/resource.cfg

They work & translate otherwise the Run Check Command wouldn't work

# NWH LDAP Credentials
$USER5$=myUserName
$USER6$=somePassword

But for whatever reason when Nagios actually runs the command it is not working...
I guess I am going to have to enable service logging...which I did not want to do...

Danny
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: Run Check Command versus Service Status Detail

Post by onegative »

You know...these are the things that just simply waste my time.

So it seems that if I use the ipAddr in the Address field $HOSTADRESS$, I end up with the following error:
ldap_bind: Can't contact LDAP server (-1)
additional info: TLS: unable to get CN from peer certificate
Could not bind to the LDAP server


When I specify the FQDN in the Address field the Bind works and I get the proper results.
I didn't catch this before because the non-ssl port 389 Service Check accepted the $HOSTADRESS$ but when performing the ssl port 636 it returns the above error.

I am not an LDAP specialist and would appreciate any feedback from someone who might know the reason for this? Even from the Command-line it fails when using the actual ipAddr.

Thanks,
Danny
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Run Check Command versus Service Status Detail

Post by gsmith »

Hi Danny,

The LDAP client must match the Common Name (CN) in the LDAP server certificate, so if the certificate is using
the FQDN then the command must use the FQDN.

Thanks
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: Run Check Command versus Service Status Detail

Post by onegative »

This can be locked and thanks everyone.
Danny
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Run Check Command versus Service Status Detail

Post by benjaminsmith »

Hi Danny,

Great! We'll close this out.

Thank you for using Nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked