I need to monitor the app pools on our web servers. I went to the Nagios exchange site and grabbed the check_iis.ps1 file. I put it in the script in c:\Program Files\NSClient++\Scripts\. I then modified the NSC.ini file by adding the following lines:
Code: Select all
[Script Wrappings]
ps1 = cmd /c echo scripts\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
[Wrapped Scripts]
check_iis=check_iis.ps1 $ARG1$
Unfortunately,
It is having issues with the lastexit line. I have attached a picture of the error.
Any idea of what I did wrong?
Thanks!