NSClient Not Working
NSClient Not Working
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
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
Re: NSClient Not Working
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.
Re: NSClient Not Working
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
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
Re: NSClient Not Working
To find the version the NSClient++ agent, go to this folder
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.
Then run the following to validate the NSClient++ configuration.
Any errors, fix them and retest the command from the Nagios server to see if it works.
One more thing, post the command definition for the Disk and Memory checks in Nagios here so we can see the actual command.
Code: Select all
C:\Program Files\NSClient++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++>Code: Select all
nscp settings --validateCode: Select all
./check_nt -H IPADDR01 -p 12489 -v CLIENTVERSIONBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: NSClient Not Working
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]#
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.
Re: NSClient Not Working
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!
Re: NSClient Not Working
Replied via a PM.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NSClient Not Working
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?
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
Are you sure the service is running? There almost always should be a log file.mkeey wrote: There isn't a nsclient log file so there's no errors to see for these two. Suggestions?
Also check the firewalls on the servers to make sure the communication isn't being blocked there for ports 12489 and 5666.