mickem / nscp

NSClient++
http://nsclient.org
GNU General Public License v2.0
244 stars 94 forks source link

NSClient++ does not work Microsoft Azure Windows Server #614

Open kasperbrandenburg opened 5 years ago

kasperbrandenburg commented 5 years ago

Issue and Steps to Reproduce

Running NSClient++, Version: 0.5.2.35 in Azure on (IaaS) Windows Server 2016 the agent throws an error when asked to run a check locally. This happens both when running as Service, and when running manually under a local-admin user-account.

This also happen with using check_nrpe from central Nagios server. But since the problem can be reproduced on a single Windows VM, this is not a network issue.

check_nrpe.exe -H 127.0.0.1

I've tested this locally, and here the NSClient version works just fine. So the problem is related to running the NSClient version on Azure IaaS

Expected Behavior

Check should run and report back with result.

Actual Behavior

check_nrpe reports and error and exits C:\Program Files\NSClient++>check_nrpe.exe -H 127.0.0.1 Error: Failed to connect to: 127.0.0.1:5666 :short read

Details

Additional Details

NSClient++ log:

C:\Program Files\NSClient++>
C:\Program Files\NSClient++>nscp.exe test
D       core NSClient++ 0.5.2.35 2018-01-28 x64 Loading settings and logger...
D       core Settings not ready so we cant lookup: base-path
D       core Settings not ready so we cant lookup: exe-path
D   settings Boot.ini found in: C:\Program Files\NSClient++/boot.ini
D       core Settings not ready so we cant lookup: shared-path
D   settings Activating: ini://${shared-path}/nsclient.ini
D   settings Creating instance for: ini://${shared-path}/nsclient.ini
D       core Settings not ready so we cant lookup: shared-path
D   settings Loading: C:\Program Files\NSClient++/nsclient.ini
D       core NSClient++ 0.5.2.35 2018-01-28 x64 booting...
D       core Booted settings subsystem...
D       core On crash: restart: NSCP
D       core Archiving crash dumps in: C:\Program Files\NSClient++/crash-dumps
D       core Found: CheckDisk
D       core Found: CheckExternalScripts
D       core Found: CheckSystem
D       core Found: NRPEServer
D       core Loading module C:\Program Files\NSClient++\modules\CheckDisk.dll ()
D       core Loading module C:\Program Files\NSClient++\modules\CheckExternalScripts.dll ()
D       core Loading module C:\Program Files\NSClient++\modules\CheckSystem.dll ()
D       core Loading module C:\Program Files\NSClient++\modules\NRPEServer.dll ()
D       core Loading plugin: CheckDisk
D       core Loading plugin: CheckExternalScripts
D ext-script No aliases found (adding default)
D       core Loading plugin: CheckSystem
D       core Loading plugin: NRPEServer
D       nrpe Allowed hosts definition: 127.0.0.1(255.255.255.255)
D       nrpe Server config: address: :5666, ssl disabled
D       nrpe Binding to: [::]:5666(ipv6)
D       nrpe Attempting to bind to: [::]:5666(ipv6)
D       nrpe Binding to: 0.0.0.0:5666(ipv4), reopen: true, reuse: true
D       nrpe Attempting to bind to: 0.0.0.0:5666(ipv4)
D       core NSClient++ - 0.5.2.35 2018-01-28 Started!
D       core Loading module C:\Program Files\NSClient++\modules\CommandClient.dll ()
D       core Loading plugin: CommandClient...
D        cli Enter command to execute, help for help or exit to exit...
D  w32system Loading counter: disk_queue_length_0 C: = \\tol001\PhysicalDisk(0 C:)\% Disk Time
D  w32system Loading counter: disk_queue_length_1 D: = \\tol001\PhysicalDisk(1 D:)\% Disk Time
D  w32system Loading counter: disk_queue_length__Total = \\tol001\PhysicalDisk(_Total)\% Disk Time
D       nrpe Accepting connection from: 127.0.0.1, count=1
E       nrpe Failed to read data: The I/O operation has been aborted because of either a thread exit or an application request
                    c:\source\master\include\socket/connection.hpp:168
mintsoft commented 5 years ago

I'd suggest trying https://github.com/mickem/nscp/releases/tag/0.5.2.41; it might behave better

kasperbrandenburg commented 5 years ago

I've tried using the latest pre-release 5.3.4 and its the same behavior. Now i am currently running in unsecure mode, as i wanted to test before taking on the challenge of certificates. Lookin in the op5 samle config i see some notes on SSL being broken. I wonder is this is related somehow? I'll continue to try with more configs, and possible look into adjusting loglevels. Hopefully i can find something usefull.