NSClient++ could not fetch information from server


#1

I am unable to get connected from nagios server to nsclient(windows server) , I keep getting the “could not fetch information from server” when I ran any command on to check.

Below is the settings and logs, please advice.

Nagios® Core™ 4.3.4

NSClient++ 0.5.1.44 2017-08-30 x64 This is windows server

NSCP settings --validate This returns nothing, assuming no errors.

nsclient.ini contents [/settings/default] allowed hosts = 10.10.10.24

**[/settings/NRPE/server]**
ssl options =
verify mode = none
insecure = true
use ssl = 1
allow arguments = true
allow nasty characters = true

**[/modules]**
 CheckExternalScripts = enabled
 CheckHelpers = enabled
 CheckNSCP = enabled
 CheckDisk = enabled
; WEBServer = enabled
 CheckSystem = enabled
 NSClientServer = enabled
 CheckEventLog = enabled
 NSCAClient = enabled
NRPEServer = enabled

nsclient.log

2018-01-12 03:33:54: debug:c:\source\master\service\logger\nsclient_logger.cpp:52: Creating logger: threaded-file
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:264: NSClient++ 0.5.1.44 2017-08-30 x64 Loading settings and logger...
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:1452: Settings not ready so we cant lookup: base-path
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:1452: Settings not ready so we cant lookup: exe-path
2018-01-12 03:33:54: debug:c:\source\master\libs\settings_manager\settings_manager_impl.cpp:164: Boot.ini found in: C:\Program Files\NSClient++/boot.ini
2018-01-12 03:33:54: debug:c:\source\master\libs\settings_manager\settings_manager_impl.cpp:182: Activating: ini://C:/Program Files/NSClient++/nsclient.ini
2018-01-12 03:33:54: debug:c:\source\master\libs\settings_manager\settings_manager_impl.cpp:83: Creating instance for: ini://C:/Program Files/NSClient++/nsclient.ini
2018-01-12 03:33:54: debug:c:\source\master\include\settings/impl/settings_ini.hpp:295: Loading: C:/Program Files/NSClient++/nsclient.ini
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:272: NSClient++ 0.5.1.44 2017-08-30 x64 booting...
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:273: Booted settings subsystem...
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:333: On crash: restart: NSCP
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:345: Archiving crash dumps in: C:\Program Files\NSClient++/crash-dumps
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:371: booting::loading plugins
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckDisk
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckEventLog
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckExternalScripts
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckHelpers
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckNSCP
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: CheckSystem
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: NRPEServer
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: NSCAClient
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:198: Found: NSClientServer
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckDisk.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckDisk.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckEventLog.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckEventLog.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckExternalScripts.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckExternalScripts.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckHelpers.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckHelpers.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckNSCP.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckNSCP.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CheckSystem.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CheckSystem.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\NRPEServer.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\NRPEServer.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\NSCAClient.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\NSCAClient.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\NSClientServer.dll.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\NSClientServer.dll
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckDisk
2018-01-12 03:33:54: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckEventLog
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckExternalScripts
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckExternalScripts\CheckExternalScripts.cpp:131: No aliases found (adding default)
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckHelpers
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckNSCP
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckNSCP\CheckNSCP.cpp:51: Crash folder is: C:\Program Files\NSClient++/crash-dumps
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: CheckSystem
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: NRPEServer
2018-01-12 03:33:55: debug:c:\source\master\modules\NRPEServer\NRPEServer.cpp:126: Allowed hosts definition: 10.10.10.24(255.255.255.255)
2018-01-12 03:33:55: debug:c:\source\master\modules\NRPEServer\NRPEServer.cpp:127: Server config: address: :5666, ssl enabled: none, no certificate, dh: C:\Program Files\NSClient++/security/nrpe_dh_512.pem, ciphers: ADH, ca: C:\Program Files\NSClient++/security/ca.pem, options: 
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckSystem\pdh_thread.cpp:169: Loading counter: disk_queue_length_2 C: D: = \\WINDEV04\PhysicalDisk(2 C: D:)\% Disk Time
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckSystem\pdh_thread.cpp:169: Loading counter: disk_queue_length_3 E: = \\WINDEV04\PhysicalDisk(3 E:)\% Disk Time
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckSystem\pdh_thread.cpp:169: Loading counter: disk_queue_length_0 D: = \\WINDEV04\PhysicalDisk(0 D:)\% Disk Time
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckSystem\pdh_thread.cpp:169: Loading counter: disk_queue_length_1 E: = \\WINDEV04\PhysicalDisk(1 E:)\% Disk Time
2018-01-12 03:33:55: debug:c:\source\master\modules\CheckSystem\pdh_thread.cpp:169: Loading counter: disk_queue_length__Total = \\WINDEV04\PhysicalDisk(_Total)\% Disk Time
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:111: Binding to: [::]:5666(ipv6)
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:214: Attempting to bind to: [::]:5666(ipv6)
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:107: Binding to: 0.0.0.0:5666(ipv4), reopen: true, reuse: true
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:214: Attempting to bind to: 0.0.0.0:5666(ipv4)
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: NSCAClient
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:648: Loading plugin: NSClientServer
2018-01-12 03:33:55: debug:c:\source\master\modules\NSClientServer\NSClientServer.cpp:87: Allowed hosts definition: 10.10.10.24(255.255.255.255)
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:111: Binding to: [::]:12489(ipv6)
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:214: Attempting to bind to: [::]:12489(ipv6)
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:107: Binding to: 0.0.0.0:12489(ipv4), reopen: true, reuse: true
2018-01-12 03:33:55: debug:c:\source\master\include\socket/server.hpp:214: Attempting to bind to: 0.0.0.0:12489(ipv4)
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:472: NSClient++ - 0.5.1.44 2017-08-30 Started!
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:687: C:\Program Files\NSClient++/modules\CommandClient.dll.dll
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:689: adding C:\Program Files\NSClient++/modules\CommandClient.dll
2018-01-12 03:33:55: debug:c:\source\master\service\NSClient++.cpp:883: Loading plugin: CommandClient...
2018-01-12 03:33:55: debug:c:\source\master\modules\CommandClient\CommandClient.cpp:133: Enter command to execute, help for help or exit to exit...
2018-01-12 03:34:21: error:c:\source\master\include\nrpe/server/protocol.hpp:98: Rejected connection from: 10.10.10.24

#2

Make sure you use the right port numbers - check_nt is port = 12489 check_nrpe is port = 5666 Drop the firewalls on nagios master server and windows client machine to test. Good luck! —Roman


#3

Means the serveris not allowed to connect (assuming thats your nagios machine).

Add that ip to the list of allowed hosts:

[/settings/default]
allowed hosts=10.10.10.24