NRPE: Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
larp
Posts: 13
Joined: Mon Mar 23, 2015 12:03 pm

NRPE: Unable to read output

Post by larp »

I have download the check_zfs.pl from the exchange site, and get a "NRPE: Unable to read output" when I use it, it runs well without nrpe both as root and as the nagios user.
this is the output that I get, I also showed the output from "check_swap.pl" which works fine.
This is the output from the client:
root@W96248:global # id
uid=0(root) gid=0(root)
root@W96248:global # ls -l check_zfs.pl
-rwxr-xr-x 1 nagios bin 18390 Mar 31 15:15 check_zfs.pl
root@W96248:global # ./check_nrpe -H 127.0.0.1
NRPE v2.14
root@W96248:global # ./check_nrpe -H 127.0.0.1 -t 30 -c check_zfs -a '-p'
NRPE: Unable to read output
root@W96248:global # ./check_zfs.pl -p
OK: ZFS on W96248 - No zfs failures detected
root@W96248:global # ./check_nrpe -H 127.0.0.1 -t 30 -c check_swap -a '-w 30% -c 20% -m swap'
OK: Available swap (85.0%) > warning threshold (30.0%)|available=57729836kB free=49087576kB allocated=8169424kB reserved=472836kB used=8642260kB
root@W96248:global # su - nagios
Oracle Corporation SunOS 5.10 Generic Patch January 2005
-bash-3.2$ cd /opt/nagios/libexec
-bash-3.2$ ./check_zfs.pl -p
OK: ZFS on W96248 - No zfs failures detected
-bash-3.2$ id
uid=346(nagios) gid=139(nagios)
-bash-3.2$ ./check_nrpe -H 127.0.0.1 -t 30 -c check_zfs -a '-p'
NRPE: Unable to read output
-bash-3.2$
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: NRPE: Unable to read output

Post by jdalrymple »

Hi larp,

I found this promising little bit of documentation: http://tech.ebusinessjuncture.com/2009/ ... n-solaris/

The output you're getting is usually indicative of the actual binary/script that runs under NRPE being unexecutable or the nagios/nrpe user being unable to find it, so that guy is likely on to something. Take a look and let us know if that helps.
larp
Posts: 13
Joined: Mon Mar 23, 2015 12:03 pm

Re: NRPE: Unable to read output

Post by larp »

Hi

Check that, I can run other perl script e.g. check_mem.pl without any issues, this is the only script that gives that error.

Best
Lars
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: NRPE: Unable to read output

Post by jdalrymple »

This "feels" like an selinux issue, although it is most definitely not. NRPE isn't running chrooted is it? That may be the issue. I'm guessing the deep-underlying problem isn't so much the check_zfs.pl script as it is the ability for the nagios user to call the zfs binary (no doubt part of that script) from the NRPE created env.

Maybe make sure all the paths are absolute in the script, and also absolute path in your nrpe.cfg?
larp
Posts: 13
Joined: Mon Mar 23, 2015 12:03 pm

Re: NRPE: Unable to read output

Post by larp »

Hi

Nice hint I found that the script could only run in /opt/nagios/libexec, until I change the lib line to

use lib "/opt/nagios/libexec";

Thank you for your help.

Best
Lars
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NRPE: Unable to read output

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked