Page 1 of 1
NCPA need to run 64 bit version of powershell
Posted: Tue Jun 08, 2021 10:08 am
by btayl
I am running a powershell script that uses a FailoverClusters 64bit module not found in the 32bit powershell called NCPA need to run 64 bit version of powershell and load the module. added a copy of the powershell script
Re: NCPA need to run 64 bit version of powershell
Posted: Tue Jun 08, 2021 2:40 pm
by ssax
If you look at the bottom of the ncpa.cfg on the remote machine you should see this:
Code: Select all
# Since windows NCPA is 32-bit, if you need to use 64-bit powershell, try the following for
# the powershell plugin definition:
# .ps1 = c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File $plugin_name $plugin_args
Please change this:
Code: Select all
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
To this:
Code: Select all
.ps1 = c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File $plugin_name $plugin_args
Then restart the NCPA services on the system and test it again.
Re: NCPA need to run 64 bit version of powershell
Posted: Wed Jun 09, 2021 7:39 am
by btayl
That worked
Now I am trying a different script
this is what it looks like in powershell
checkClusterOwner.ps1 'UHSPCNTDBCPR' 'SQL Server (MSSQLSERVER)'
how would I pass the argument in nagios?
Re: NCPA need to run 64 bit version of powershell
Posted: Thu Jun 10, 2021 9:55 am
by ssax
You can try this:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H 192.168.X.X -t 'mytoken' -P 5693 -M plugins/checkClusterOwner.ps1 -a 'UHSPCNTDBCPR' 'SQL Server (MSSQLSERVER)'
One of the best parts of NCPA is if you go to
https://YOURNCPAHOST:5693 and click the API it will show you what options are available and can help you construct the commands you need. Once you get one setup if you click the Run as a nagios check box another button on the bottom left shows up, if you click that View in alternative format button and click Active or Passive it will show you what command you should use.
See here as well:
https://www.nagios.org/ncpa/help.php
https://support.nagios.com/kb/article/n ... a-722.html