CPU, Memory staus = NRPE Unable to read output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

CPU, Memory staus = NRPE Unable to read output

Post by tecnalb »

I sent a new server this weekend. Its RHEL6x64, latest patches.

I installed the linux-nape from the link on my NXI server, which also is the latest.

On CPU, memory, open files its all NRPE unreadable... other items are fine

[root@nagios libexec]# ./check_nrpe -H x.x.x.x -c check_cpu_stats -a '-w 85 -c 95'
NRPE: Unable to read output

I ran the local check_cpu_stats.sh and got this:

[root@host1 libexec]# ./check_cpu_stats.sh
./check_cpu_stats.sh: line 139: [: 0.00: integer expression expected
./check_cpu_stats.sh: line 142: [: 0.00: integer expression expected
./check_cpu_stats.sh: line 152: [: 0.05: integer expression expected
./check_cpu_stats.sh: line 156: [: 0.05: integer expression expected
./check_cpu_stats.sh: line 160: [: 0.00: integer expression expected
./check_cpu_stats.sh: line 164: [: 99.90: integer expression expected
CPU STATISTICS OK: user=0.05% system=0.05% iowait=0.00% idle=99.90% | user=0.05% system=0.05% iowait=0.00%;30;100 idle=99.90%

So I am comparing this device to a working device I setup a week ago, which is the same OS, and the modules seem to be the same.

My NXI GUI the setting commands look the same. One works one does not. I did update my wizard to the latest version as well.

So at this point I have manually/locally run checks and I get feedback from both, locally


Also, just an FYI, the nrpe install script is overwriting the iptable files. I had two entries in mine.... the time i installed the agent. Beautiful!!

# Generated by iptables-save v1.4.7 on Sat Feb 28 12:48:05 2015
*filter
:INPUT ACCEPT [5:260]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5667 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5666 -j ACCEPT
COMMIT
# Completed on Sat Feb 28 12:48:05 2015
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: CPU, Memory staus = NRPE Unable to read output

Post by Box293 »

Basically the script is getting bash to compare non integer numbers (numbers with decimal places) and bash complains about this.

To correct the problem, I've adjusted the script so the numbers it's comparing are integers ... I'm basically removing anything after the .

This update script should work for you:
check_cpu_stats.zip
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

Re: CPU, Memory staus = NRPE Unable to read output

Post by tecnalb »

Thanks for the update. I'll give it a shot. However, I'm not sure it's my underlying issue. Seems my working server is displaying the same results when run on the local host. There is something else causing my results to not be passed back to NXI. I'm just not sure what at this point.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: CPU, Memory staus = NRPE Unable to read output

Post by jolson »

Regarding "NRPE: Unable to read output", this could be caused by a variety of things. It is common that the issue could be related to permissions or SELinux Policy.

For SELinux, you could try:

Code: Select all

getenforce
If getenforce is Enforcing, you could temporarily disable it with:

Code: Select all

setenforce 0
After disabling SELinux, retry the procedure.

If SELinux isn't the culprit, be sure that the permissions for the files on your remote machine are set properly:

Code: Select all

ls -lZ /usr/local/nagios/libexec
The permissions should match the rest of the files in libexec (755 perms).

This could also be caused by sudo issues. Please report the following:

Code: Select all

cat /etc/sudoers | grep tty
Also, try running the check through NRPE using the remote host:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost -c myplugin
Please report back and let us know the results of the above. Thanks very much!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

Re: CPU, Memory staus = NRPE Unable to read output

Post by tecnalb »

Ahhh.... SELINUX was disabled, but was not when I installed the agent. So those files permissions were set 750.

Thank you sir!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: CPU, Memory staus = NRPE Unable to read output

Post by jolson »

Not a problem. I'll go ahead and lock this case out. Thanks!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked