First of all: vbs and nrpe are functioning, my only problem is with Powershell.
I run 2003 server with NRPE_NT 0.8.0. All works great executing vbs-scripts (integrate and extract info via Openmanage on Dell servers for example)
When I try to launch a powershell script (ps1) check_nrpe reports timeout. Task seem to hang on server. I enabled logging on the host and indeed it is a timeout and process powershell is hung (terminated after 30 sec by default).
from the log:
2007-09-26 15:35:00; 3352; 7;Host is asking for command ‘check_kms’ to be run…
2007-09-26 15:35:00; 3352; 7;Running command: c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -command c:\latest-kms.ps1
2007-09-26 15:35:30; 3352; 7;Command completed with return code 5
2007-09-26 15:35:30; 3352; 4;Bad return code for [The check didn’t respond within the timeout period!]: 5
I tried cut & paste the command executed by nrpe according to its log. Works perfectly when run interactively in the host.
Figured unicode might be a problem so I disabled output and just returned exit code. No luck.
Changed nrpe-service to run under administrator, no luck.
Question: how to run Powershell scripts from nrpe_nt? I have seen at least one more thread re this.
/// Sample script ///
$a = Get-EventLog “key management service” -newest 1
$m = [RegEx]::Matches($a.message, ‘0x0,25,(.*?),’)
$a.TimeGenerated.DateTime + " host: " + $m[0].groups[1].value
/// nrpe.cfg ///
command[check_kms]=c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -command c:\latest-kms.ps1