I'm trying to run an Powershell script from NRPE.cfg and get the output in Nagios.
When i run the script on the local (Windows) server, everything is just fine. But when i put it in the NRPE.cfg en try to get the output in Nagios, i get an Unable to Read Output error.
Searched the internet but can't find the solution, so maybe you can help me out..
The command/script is:
command[check_veeam_dailyone]=cmd /c echo c:\install\veeam_check.ps1 ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -noninteractive -noprofile -File -
When i put this on the Windows server in PowerShell, i'll get this output:
PS C:\Install> OK - Job: VeeamOne_Daily completed successfully at 10/09/2014 04:45:51.
The "PS C:\Install>" part is strange, but it does read the last job, so seems 'okay'..
But when I try to get this output in Nagios with:
root@nagios:~# /usr/lib/nagios/plugins/check_nrpe -H 192.168.1.1 -t 300 -c check_veeam_dailyone
NRPE: Unable to read output
NRPE is running fine, cause when i try to get another command, like the C drive, everything is OK:
/usr/lib/nagios/plugins/check_nrpe -H 192.168.1.1 -t 300 -c pdm_disk_c DISK OK - usage: C: 38717.2 MB (63.12% of total 61337.0 MB)|'disk in use'=38717.2MB; 'disk usage'=63.12%;90;95; 'disk total'=61337.0MB;
Just can't figure out whats wrong.
The script i use is this one:
Thanks for your reply!