I have a command which checks my windows service and an eventhandler which restarts this service if it´s not started.
/usr/lib64/nagios/plugins/check_nrpe -H $address$ -p 5666 -c check_winservice -a $Servicename$
restart_service = powershell.exe scripts\restart_service.ps1 "$ARGS$"; exit($lastexitcode) | powershell.exe -command -
check_winservice = powershell.exe scripts\win_service.ps1 "$ARGS$"; exit ($lastexitcode) | powershell.exe -command -
This works if the servicename has no space included ....like "spooler"
But i have a view services with spaces in the servicename.
Is there any way to fix this, because i don´t want to write every service hard coded in my nsclient.ini.