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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
oneida
Posts: 15
Joined: Tue Sep 25, 2012 1:11 pm
Location: New York

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked