check_ms_iis_application_pool powershell auth issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkelly1959
Posts: 49
Joined: Tue Jun 06, 2017 10:59 am

check_ms_iis_application_pool powershell auth issue

Post by jkelly1959 »

Our standard powershell execution policy setting is Restricted

Setting the policy to unrestricted does NOT help.
Here is error that we get when unrestricted.

check failed.

At line:1 char:1

+ scripts/powershell/check_ms_iis_application_pool.ps1 -A Diamond; exit ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : SecurityError: (:) [], PSSecurityException

+ FullyQualifiedErrorId : UnauthorizedAccess




I have been able to get it to run setting the policy on the windows server to bypass. However we really dont want to do that on the windows server.

I have tried to add the switch -ExecutionPolicy to bypass in the wrappings of the nsclient ini file but not having luck there or sure I am doing it right. I will attach nsclient ini.

I have been able to get this plugin to work when I set the server execution policy to Bypass.

Any suggestions on how to get this to run?

Thanks
John
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_ms_iis_application_pool powershell auth issue

Post by ssax »

Please change your last line to this:

Code: Select all

check_ms_iis_application_pool=cmd /c echo scripts/powershell/check_ms_iis_application_pool.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -ExecutionPolicy Bypass -command -
Then restart the NSClient++ service and test again.

Thank you
jkelly1959
Posts: 49
Joined: Tue Jun 06, 2017 10:59 am

Re: check_ms_iis_application_pool powershell auth issue

Post by jkelly1959 »

Don't I feel silly....Than Worked!

Thank you
Locked