Page 3 of 5
Re: NSClient Not Working
Posted: Mon Jul 15, 2019 8:11 am
by mkeey
Results of the nmap command from the Nagios XI server to the Nagios Agent's Host...
Starting Nmap 6.47 (
http://nmap.org ) at 2019-07-15 09:08 EDT
Nmap scan report for REMOTENAGIOSAGENTHOST (REMOTENAGIOSAGENTIP)
Host is up (0.00020s latency).
PORT STATE SERVICE
5666/tcp open nrpe
12489/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
Here is the NSCLIENT.INI information...
# 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 = NAGIOSXI01,NAGIOSXI02,NAGIOSXI03,NAGIOSXI04
; 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
Posted: Mon Jul 15, 2019 9:44 am
by lmiltchev
Try adding the following under the
[/settings/NRPE/server] section:
Code: Select all
insecure = true
use ssl = 1
allow nasty characters = 1
allow arguments = 1
port = 5666
extended response = 0
allowed ciphers = ALL:!MD5:@STRENGTH
verify mode = none
save, exit, and restart NSClient++ service.
Does it work now?
Is there any program/application that is using the same port (5666) on the client? You can open a CMD prompt, and run:
or
to find out.
Re: NSClient Not Working
Posted: Mon Jul 15, 2019 10:01 am
by mkeey
Added the lines as you requested and I got an "Invalid Drive" for the C drive Disk Check and then a "could not fetch information from server" for Memory.
Then ran the netstat command...
U:\>netstat -a -b | find "5666"
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
x: Windows Sockets initialization failed: 5
FYI - This is a Windows 2007 box.
Re: NSClient Not Working
Posted: Mon Jul 15, 2019 11:05 am
by lmiltchev
Did you forget to add the "header"?
You should have:
Code: Select all
[/settings/NRPE/server]
insecure = true
use ssl = 1
allow nasty characters = 1
allow arguments = 1
port = 5666
extended response = 0
allowed ciphers = ALL:!MD5:@STRENGTH
verify mode = none
Depending on the version of NSClient++ that you are using, some of these options may not work. You can also try this:
Code: Select all
[/settings/NRPE/server]
verify mode = none
insecure = true
ssl options =
allow arguments = true
allow nasty characters = true
use ssl = 1
port = 5666
extended response = 1
in case settings in the first example don't work for you.
Can you post the
nsclient.log on the forum?
Re: NSClient Not Working
Posted: Wed Jul 17, 2019 6:26 am
by mkeey
Here is a copy of the 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 = NAGIOSXI1,NAGIOSXI2,NAGIOSXI3,NAGIOSXI4,NAGIOSXI5
; 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]
insecure = true
use ssl = 1
allow nasty characters = 1
allow arguments = 1
port = 5666
extended response = 0
allowed ciphers = ALL:!MD5:@STRENGTH
verify mode = none
; 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
Posted: Wed Jul 17, 2019 6:33 am
by mkeey
Uploaded the client log via private message due to proprietary data - MKeey
Re: NSClient Not Working
Posted: Wed Jul 17, 2019 8:29 am
by mkeey
Ok, here is something interesting. I noticed that Nagios has a wizard for Windows Workstations. Since this is a Win7 machine, I thought I'd change the definition from a server to a workstation. Deleted the old services and host and ran the Windows Workstation wizard. First I did this on my Test XI and it worked just fine. All monitoring was functioning as desired. Thought I'd hit upon a fix! Then I did the same thing on my Production XI and I'm getting the same failures.
[NAGIOSXI@TESTXI ~]$ /usr/local/nagios/libexec/check_nt -H 000.00.0.000 -s "" -p 12489 -v USEDDISKSPACE -l C -w 90 -c 95
C:\ - total: 60.00 Gb - used: 27.20 Gb (45%) - free 32.80 Gb (55%) | 'C:\ Used Space'=27.20Gb;54.00;57.00;0.00;60.00
[NAGIOSXI@PRODXI ~]$ /usr/local/nagios/libexec/check_nt -H 000.00.0.000 -s "" -p 12489 -v USEDDISKSPACE -l C -w 90 -c 95
Free disk space : Invalid drive
What the..? Both XI's are defined as allowed hosts in the INI file.
Re: NSClient Not Working
Posted: Wed Jul 17, 2019 8:39 am
by tgriep
Thanks for the log file, not much to go on in it.
The some settings in your nsclient.ini file are missing and are not is the right place so I posted a known good copy.
All you should have to do it to add your hosts in the allowed hosts option and to update the password if you are using it.
Update the file, restart NSClient++ and see if it works.
In the example, debugging is enabled so there should be more information in the nsclient.log file.
Code: Select all
# If you want to fill this file with all available 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
[/settings/default]
password = password
allowed hosts = 127.0.0.1,***.***.***.***
[/settings/NRPE/server]
verify mode = none
insecure = true
ssl options =
allow arguments = true
allow nasty characters = true
use ssl = 1
port = 5666
extended response = 1
[/modules]
CheckExternalScripts = 1
CheckHelpers = 1
CheckNSCP = 1
CheckDisk = 1
CheckSystem = 1
NSClientServer = 1
CheckEventLog = 1
NSCAClient = 0
WEBSErver = 0
NRPEServer = 1
[/settings/NSClient/server]
use ssl = 0
performance data = 1
port = 12489
[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
bat = scripts\\%SCRIPT% %ARGS%
An alias is an internal command that has been predefined to provide a single command without arguments. Be careful so you don't create loops (ie check_loop = check_a, check_a=check_loop)
vbs = cscript.exe //T:30 //NoLogo scripts\\lib\\wrapper.vbs %SCRIPT% %ARGS%
[/settings/external scripts]
allow arguments = true
allow nasty characters = true
timeout = 120
[/settings/log]
; LOG LEVEL - Log level to use. Available levels are error,warning,info,debug,trace
level = trace
; FILENAME - The file to write log data to. Set this to none to disable log to file.
file name = nsclient.log
; DATEMASK - The size of the buffer to use when getting messages this affects the speed and maximum size of messages you can recieve.
date format = %Y-%m-%d %H:%M:%S
[/settings/log/file]
; MAXIMUM FILE SIZE - When file size reaches this it will be truncated to 50% if set to 0 (default) truncation will be disabled
max size = 2048000
Re: NSClient Not Working
Posted: Wed Jul 17, 2019 9:31 am
by mkeey
Updated INI file and restarted NSCLIENT service. Ran checks manually via CCM. No change...
[NAGIOSXI@remotehost ~]$ /usr/local/nagios/libexec/check_nt -H 000.00.0.000 -s "" -p 12489 -v MEMUSE -w 90 -c 95
could not fetch information from server
[NAGIOSXI@remotehost ~]$ /usr/local/nagios/libexec/check_nt -H 000.00.0.000 -s "" -p 12489 -v USEDDISKSPACE -l C -w 90 -c 95
Free disk space : Invalid drive
And it made matters worse as now my test system isn't working either. Everything was failing with Invalid Password.
So, I commented out the password field and restarted the service again.
Things are still failing on the Prod XI but at least the Test XI is working again!
Re: NSClient Not Working
Posted: Wed Jul 17, 2019 11:59 am
by tgriep
On both the Test server and the production server, run the following so we can view the version of the check_nt plugin and to see if it can connect to the Windows system.
Code: Select all
/usr/local/nagios/libexec/check_nt -V
/usr/local/nagios/libexec/check_nt -H xxx.xxx.xxx.xxx -s "" -p 12489 -v CLIENTVERSION
ip addr
In the allowed hosts option in the nsclient.ini file, put in the IP address of the Nagios Prod server to rule out a DNS issue.
Post the errors / messages that should be in the nsclient.log file when the prod server tries to connect to the Windows system.