AnswerBun.com

NRPE (Winrpe) Powershell Command - Unable to read output in Nagios

Server Fault Asked by J2014 on January 3, 2022

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:installveeam_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

It says:

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:

http://exchange.nagios.org/directory/Plugins/Backup-and-Recovery/Others/check_veeam_backups/details

Thanks for your reply!

One Answer

  1. I would first try to reduce the complexity of the script to let's say...

    echo "Hello World" and see if that works.

  2. More than that, NRPE is usually ran by the user which is called nrpe (unless specified otherwise) so when you run your checks, run them from the nrpe user rather than from root.
  3. Also make sure that "dont_blame_nrpe" is set to "1" in nrpe.cfg on the monitored machine.
  4. Another thing you can try is wrapping this:

cmd /c echo c:installveeam_check.ps1 ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -noninteractive -noprofile -File -

within a batch file (.bat) and then change the command in NRPE to something simpler like so:

command[check_veeam_dailyone]=yourscript.bat

Then try to run the command again and see if that works.

Answered by Itai Ganot on January 3, 2022

Add your own answers!

Related Questions

Port not responding remotely, but shows as open locally

1  Asked on November 12, 2021 by avjinder-sekhon

       

nginx error 500 when making api request to backend container

0  Asked on November 12, 2021 by christian-geng

         

Understanding smartd

1  Asked on November 12, 2021 by dovid-bender

     

mdadm alerts configuration

0  Asked on November 12, 2021 by mindserver

   

Cannot restart apache after certificate replacement

1  Asked on November 12, 2021 by kyle-banerjee

   

Reverse proxying a HLS stream with nginx

0  Asked on November 12, 2021 by mayleap1

         

Varnish PURGE client.ip docker-compose

1  Asked on November 12, 2021 by zhartaunik

   

Nginx refuses custom error pages

1  Asked on November 12, 2021

       

splitting tcp traffic to multiple recipients on the backend?

1  Asked on November 12, 2021 by kevin-martin

       

Curl – download file range

2  Asked on November 10, 2021

 

apache times out with low cpu and memory usage

1  Asked on November 10, 2021 by develth

     

MySQL Cluster SQL Node not synchronizing

1  Asked on November 10, 2021 by user2249803

   

nginx: different configuration based on cookie

2  Asked on November 10, 2021 by jay-paroline

 

How to connect to Windows Nano Server via SSH?

2  Asked on November 10, 2021 by andre-figueiredo

     

Redirect to localhost:8080?

3  Asked on November 10, 2021 by meds

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP