Some extra info I found:
- the execution policy for scripts is different between the x64 and the x86 
subsystem. So you need to set the execution policy in the x86 powershell too.
- nrpe_nt is running as a x86 service, and my check script loads the Exchange 
snapin ... which can only be used in a x64 script.

Solution would be to:
- either run the nrpe_nt service as native x64 service
- get the Exchange snapin to load in an x86 subsystem (pretty unlikely with 
Exchange 2010, as it is 64-bit only).

More thoughts on a solution?

Toni Van Remortel
System Engineer @ Precision Operations N.V.
Satenrozen 2a - B-2550 Kontich - Belgium
+32 3 451 92 26
________________________________
From: opsview-users-boun...@lists.opsview.org 
[opsview-users-boun...@lists.opsview.org] on behalf of Toni Van Remortel 
[toni.van.remor...@p-ops.be]
Sent: Wednesday, March 31, 2010 11:45
To: Opsview Users ‎[opsview-us...@lists.opsview.org]‎
Subject: [opsview-users] NRPE for Windows and Powershell scripts

Hi,

I created a powershell script that checks my Exchange 2010 DAG replication 
status, but I can't get it working via NRPE.

The commands tested:
command[mdb_01]=cmd /c echo "C:\Tasks\Check-Exchange-Database-Mdb01.ps1" | 
powershell.exe -command -
command[mdb_02]="C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" 
-nologo -command "C:\Tasks\Check-Exchange-Database-Mdb02.ps1"

Neither of them will work.
The script does return an exit code, so that's not the source of the problem.

Anybody succesfully used powershell scripts behind NRPE on Windows?

Thanks.

Toni Van Remortel
System Engineer @ Precision Operations N.V.
Satenrozen 2a - B-2550 Kontich - Belgium
+32 3 451 92 26
_______________________________________________
Opsview-users mailing list
Opsview-users@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to