Problems running NSClient as a service


#1

Hi

I’m having some troubles running NSClient as a service NSClient version 0.5.0.62 running on Windows Server 2012 R2 Standard, member of an AD domain.

If I run “nscp test”, all is working as expected, i can check scripts using “check_nrpe -H myHostname -c myScript” from a remote system, and the logfile fills up with al kinds of information. But if I install the service, and use the standard “local system account”, nothing works. A simple check_nrpe command from a remote system returns “I (0.5.0.62 2016-09-14) seem to be doing fine…”, but that’s it. If I try to check an external script, nscp returns the message “Failed to execute check_rrcs: 2: The system cannot find the file specified.”.

I have the impression that nscp, when executed as a service under the local system account, does not have access to the “c:\program files” folder (default installation location), so it can’t read its config, can’t write in the log, can’t access the scripts,… If I configure the service to log on with a domain user that has local admin rights, nscp works as expected. except that this domain user loses its “log on as a service” rights every now and then. probably because of a domain policy which I cannot change. so that’s not really an option for me.

This wasn’t a problem with nsclient 0.3.6.540 on windows server 2008 R2. I guess Microsoft tied down the access rights on 2012R2.

should I try to move scripts and logs to another folder? or uninstall and install in a different location?


#2

The process and instructions run with the local directory. If it is running as a local account, it will not and cannot provide as much information as it should.

I would suggest altering the permissions of the folder C:\Program Files\NSClient++\ and all sub folders to read/write for the local account that nscp is using. I do know the entirety of Program Files is restricted to local accounts so it would make sense that nscp cannot do anything within the sub folders of the NSClient++ folder.


#3

Turns out the local system account didn’t knew where to find Python on my machine, as the path to the executable was only set in the windows %PATH% variable for the user I log on with, not for the whole system :-/