Page 1 of 1

Running Powershell through NCPA

Posted: Mon May 24, 2021 7:21 am
by rexmundo
Hi

I am trying to run a powershell through NCPA.
The powershell is using the powercli to query a vcentre and get some metrics.

Running it by hand works fine. I've commented out the original ps1 and enabled the one with sysnative as the VMWare commandlets are 64bit so I need the 64bit version of powershell.

I enabled debug on the logs and it shows "running process with command line 'c:\windows\sysnative\windowspowershell\1.0\powershell.exe -ExecutionPolicy etc etc etc...

If I copy/paste that command and run in in dos it works fine, as long as I run it from within the NCPA folder and the path is set to be just plugin\VMConsolidateCheck.ps1
When I run it from the browser, it just times out after 60 seconds.

Any help would be appreciated here.

rgds
George

Re: Running Powershell through NCPA

Posted: Mon May 24, 2021 8:23 am
by rexmundo
We have bought for this year 2x10 calls support pack.. can we use some of that to help us with these issues as we have some deadlines we have to meet.

rgds
George

Re: Running Powershell through NCPA

Posted: Mon May 24, 2021 11:23 am
by dchurch
Can you send the contents of the NCPA logs?

Under Windows it's under C:\Program Files (x86)\Nagios\NCPA\var\log\*.log
Under Linux it's under /usr/local/ncpa/var/log/.log

Re: Running Powershell through NCPA

Posted: Mon May 24, 2021 11:26 am
by benjaminsmith
Hi George,

If you'd like to use your phone support for help, just call our main line at 1-888-624-4671 during business hours and ask for support. We'd be happy to help.

Regards,
Benajmin

Re: Running Powershell through NCPA

Posted: Tue May 25, 2021 9:11 am
by rexmundo
Hi

I've identified the issue as the CEIP!! Its hanging because its waiting for acceptance of the vmware experience program.
I've tried setting it false with scope=All users but it doesnt work if NCPA is running as local system.

The workaround is to set NCPA to run as a user/service account and then it all works fine.

The only problem I have now is the !.
The password of the VMware user contains !. When I use that, and save, Nagios escapes it with \. So it becomes \!.
But when its received by NCPA it stays as \! so the password is wrong.

Is there a way to stop this from happening?

rgds
george

Re: Running Powershell through NCPA

Posted: Tue May 25, 2021 5:42 pm
by rexmundo
ok sorted it out using User Macros!

rgds
George

Re: Running Powershell through NCPA

Posted: Wed May 26, 2021 6:11 am
by scottwilkerson
rexmundo wrote:ok sorted it out using User Macros!

rgds
George
Locking thread