Page 1 of 1

Can PS scripts be executed using NSClient (Not NSClient++)?

Posted: Fri Nov 02, 2012 9:59 am
by oneida
Hi there,

We're attempting to configure NRPE to execute a powershell script on many Windows hosts as a command check and realized that most of the documentation we've found is for NSClient++ and not the (older) NSClient.

Is the older NSClient capable of this?

Our Powershell script sits on the windows-client side and checks disk utilization for volumes. It returns 0, 1, 2, 3.

Thank you much,

Matt

Re: Can PS scripts be executed using NSClient (Not NSClient+

Posted: Fri Nov 02, 2012 10:25 am
by scottwilkerson
I believe when calling ps scripts you need to add them to the nsc.ini like so

Code: Select all

cmd /c echo scripts\script.ps1; exit($lastexitcode) | powershell.exe -command - 
http://www.nsclient.org/nscp/discussion/message/1371