Nagios: Starting NSClient++ service fails with the error ‘NSClient++ (x64) is not a valid Win32 application.’

I was recently investigating an issue where the Nagios monitoring agent (NSClient++) service failed to start with the following error message:

The NSClient++ (x64) service failed to start due to the following error:
NSClient++ (x64) is not a valid Win32 application.

In the first instance I attempted to resolve the issue by uninstalling and installing the monitoring agent on the impacted host. To which the same behaviour was experienced. On investigation, I found the following knowledge base article which describes the above symptom, where the cause of the issue is described as below:

  • The path of a service’s executable file contains spaces.
  • There is a file or folder on your computer’s hard disk that has the same name as a file or folder in the path to the service’s executable file

The first cause  above describes the condition that is causing the issue, so in order to attempt to resolve the issue I to wrapped the image path filename in quotations, as follows:

1) Browse to the registry key ‘HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NSClientpp’.

2) Modify the REG_EXPAND_SZ value data for ImagePath to be “C:\Program Files\NSClient++\nsclient++.exe”.

Following the modification I was successfully able to start the NSClient++ service and continue monitoring the host.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s