NSClient Not Working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

NSClient Not Working

Post by mkeey »

I have three problem windows servers (out of 1200) that won't communicate with the XI. We're currently monitoring Disk, CPU, Memory and a Ping on every host we have. For these three problem agents only the Disk & Memory fail to report...

Drive C: Disk Usage Unknown Free disk space : Invalid drive
Memory Usage Unknown could not fetch information from server

When I try running a check_nt command from the XI's linux server, the command displays nothing...

[nagios@XISERVER]:[/usr/local/nagios/libexec]# ./check_nt -H IPADDR01 -p 12489 -v CLIENTVERSION

[nagios@XISERVER]:[/usr/local/nagios/libexec]# ./check_nt -H IPADDR02 -p 12489 -v CLIENTVERSION

Tried the NMAP command and that looked okay...

Starting Nmap 6.47 ( http://nmap.org ) at 2019-04-26 08:34 EDT
Nmap scan report for SERVERNAMEFQDN (IPADDR01)
Host is up (0.00036s latency).
PORT STATE SERVICE
12489/tcp open unknown

Starting Nmap 6.47 ( http://nmap.org ) at 2019-04-26 08:34 EDT
Nmap scan report for SERVERNAMEFQDN (IPADDR01)
Host is up (0.00037s latency).
PORT STATE SERVICE
5666/tcp closed nrpe
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: NSClient Not Working

Post by cdienger »

What version of nsclient is installed on the machines? Is there anything logged in the nsclient.log? Feel free to post the nsc.ini or nsclient.ini files from the machines here(go through the to remove any sensitive info) and we can review the configs.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: NSClient Not Working

Post by mkeey »

Not sure how to check the version number. Please advise.

Client Log...
2019-04-29 10:35:49: error:c:\source\nscp\include\check_nt/server/protocol.hpp:67: Rejected connection from: SERVERNAME


INI File...
# If you want to fill this file with all avalible options run the following command:
# nscp settings --generate --add-defaults --load-all
# If you want to activate a module and bring in all its options use:
# nscp settings --activate-module <MODULE NAME> --add-defaults
# For details run: nscp settings --help

; Undocumented section
[/settings/default]

; Undocumented key
allowed hosts = XISERVER01,XISERVER02,XISERVER03,XISERVER04

; Undocumented section
[/modules]

; Undocumented key
CheckExternalScripts = 1

; Undocumented key
CheckHelpers = 1

; Undocumented key
CheckNSCP = 1

; Undocumented key
CheckEventLog = 1

; Undocumented key
CheckDisk = 1

; Undocumented key
CheckSystem = 1

; NSClientServer - A server that listens for incoming check_nt connection and processes incoming requests.
NSClientServer = 1

; Section for NSClient (NSClientServer.dll) (check_nt) protocol options.
[/settings/NSClient/server]

; ENABLE SSL ENCRYPTION - This option controls if SSL should be enabled.
use ssl = 0

; PERFORMANCE DATA - Send performance data back to Nagios (set this to 0 to remove all performance data).
performance data = 1

; PORT NUMBER - Port to use for check_nt.
port = 12489
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NSClient Not Working

Post by tgriep »

To find the version the NSClient++ agent, go to this folder

Code: Select all

C:\Program Files\NSClient++
Right click the nscp.exe file and click on Properties.
Click on the Details tab and it should show the version.

Try and restart the NSClient++ agent on the Windows system to make sure it reloads the nsclient.ini file.

Then, login to the Windows server and go to this folder in a command prompt.

Code: Select all

C:\Program Files\NSClient++>
Then run the following to validate the NSClient++ configuration.

Code: Select all

nscp settings --validate
Any errors, fix them and retest the command from the Nagios server to see if it works.

Code: Select all

./check_nt -H IPADDR01 -p 12489 -v CLIENTVERSION
One more thing, post the command definition for the Disk and Memory checks in Nagios here so we can see the actual command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: NSClient Not Working

Post by mkeey »

Hello, Sorry for the delayed response, numerous changes going on!

See attached for the product version.

I restarted the Agent and did the "validate" command and received no reply...

C:\>cd "Program Files"
C:\Program Files>cd "NSClient++"
C:\Program Files\NSClient++>nscp settings --validate

C:\Program Files\NSClient++>

I then did the version command and didn't receive any information...

[nagios@NAGIOSXI]:[/usr/local/nagios/libexec]# ./check_nt -H HOSTIPADDR -p 12489 -v CLIENTVERSION

[nagios@NAGIOSXI]:[/usr/local/nagios/libexec]#
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NSClient Not Working

Post by lmiltchev »

Can you PM me the entire, unredacted nsclient.ini and nsclient.log files from the Windows server? We will try to recreate the issue in-house.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: NSClient Not Working

Post by mkeey »

Done
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NSClient Not Working

Post by lmiltchev »

Replied via a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mkeey
Posts: 199
Joined: Mon Sep 25, 2017 11:13 am

Re: NSClient Not Working

Post by mkeey »

Ok, I added the IP in the log file and that did indeed fix our communication problem. Odd thing is that IP address wasn't a Nagios XI server. It's a security server that for some reason was routing communication from my XI to the remote host. Odd, but it's fixed.

However, I have two other servers that are having the same issue. The INI file is setup the same way as the previous remote host (the fixed one) and I'm getting the same errors...

Free disk space : Invalid drive for the Disk Check
could not fetch information from server for the Memory Usage.

There isn't a nsclient log file so there's no errors to see for these two. Suggestions?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NSClient Not Working

Post by scottwilkerson »

mkeey wrote: There isn't a nsclient log file so there's no errors to see for these two. Suggestions?
Are you sure the service is running? There almost always should be a log file.

Also check the firewalls on the servers to make sure the communication isn't being blocked there for ports 12489 and 5666.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked