Hello,
I recently installed nrpe on a few more servers and as far as I can tell theres no difference in the install process.
the nrpe check cpu fails with NRPE: Unable to read output but I can execute the command on the server as the nagios user with no issues.
Check memory/load other nrpe checks all pass successfully as well.
Does anyone have an idea as to why it wont run?
NRPE check_cpu_stats unable to read, but other NRPE are fine
Re: NRPE check_cpu_stats unable to read, but other NRPE are
To elaborate, I can run the command on the destination server for the cpu check fine. The check fails from the xi server.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: NRPE check_cpu_stats unable to read, but other NRPE are
Please read through this guide as it should address your issue:
https://support.nagios.com/kb/article.php?id=140
If this doesn't fix your problem, please let us know what you tried (including commands typed) and what the output/result is.
https://support.nagios.com/kb/article.php?id=140
If this doesn't fix your problem, please let us know what you tried (including commands typed) and what the output/result is.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NRPE check_cpu_stats unable to read, but other NRPE are
Followed step - VII. NRPE: Unable To Read Output
is nrpe installed? yes
check path -
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
/usr/local/nagios/libexec $ ls -d $PWD/*
/usr/local/nagios/libexec/check_cpu_stats.sh
paths match. and sh file executes fine with proper return.
/bin/bash /usr/local/nagios/libexec/check_cpu_stats.sh -w 85 -c 95
CPU STATISTICS OK: user=0.00% system=0.50% iowait=0.00% idle=99.50% | user=0.0% system=0.0% iowait=0.0%;85;95 idle=99.50%
nrpe is running - tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 12014/xinetd
Plugin does not require sudo privileges.
is nrpe installed? yes
check path -
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
/usr/local/nagios/libexec $ ls -d $PWD/*
/usr/local/nagios/libexec/check_cpu_stats.sh
paths match. and sh file executes fine with proper return.
/bin/bash /usr/local/nagios/libexec/check_cpu_stats.sh -w 85 -c 95
CPU STATISTICS OK: user=0.00% system=0.50% iowait=0.00% idle=99.50% | user=0.0% system=0.0% iowait=0.0%;85;95 idle=99.50%
nrpe is running - tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 12014/xinetd
Plugin does not require sudo privileges.
Re: NRPE check_cpu_stats unable to read, but other NRPE are
What are the permissions of /usr/local/nagios/libexec/check_cpu_stats.sh? ls -l /usr/local/nagios/libexec/check_cpu_stats.sh
Former Nagios Employee
Re: NRPE check_cpu_stats unable to read, but other NRPE are
-rwxr-xr-x 1 root root 5580 May 6 19:50 /usr/local/nagios/libexec/check_cpu_stats.sh
This is the same as my other servers.
This is the same as my other servers.
Re: NRPE check_cpu_stats unable to read, but other NRPE are
When you run the check from the command line on the remote server, are you using /bin/bash to run the command?
If so, add that to the script or edit the command in the nrpe.cfg file and add that like below.
What is the OS and version of the remote system you are trying to monitor?
If so, add that to the script or edit the command in the nrpe.cfg file and add that like below.
Code: Select all
command[check_cpu_stats]=/bin/bash /usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE check_cpu_stats unable to read, but other NRPE are
That fixed the issue.
After investigating further it looks like we are creating the nagios user ahead of time to ensure its uid/gid don't overlap on other servers, what should the shell be set to for this? Its currently using /bin/bash.
from /etc/passwd
old servers without precreating user - nagios
1012
:/home/nagios:
new servers with precreating user - nagios
1013
:/home/nagios:/bin/bash
Is there any documentation on the proper way to specify a uid/gid for nagios upon installing nrpe?
After investigating further it looks like we are creating the nagios user ahead of time to ensure its uid/gid don't overlap on other servers, what should the shell be set to for this? Its currently using /bin/bash.
from /etc/passwd
old servers without precreating user - nagios
new servers with precreating user - nagios
Is there any documentation on the proper way to specify a uid/gid for nagios upon installing nrpe?
Re: NRPE check_cpu_stats unable to read, but other NRPE are
The default shell is /bin/bash for the nagios user account.
Is there a reason you want to set the same uid/gid for the nagios account?
Here are the instructions for Installing NRPE. Take a look at them for any details.
Is there a reason you want to set the same uid/gid for the nagios account?
Here are the instructions for Installing NRPE. Take a look at them for any details.
Code: Select all
https://assets.nagios.com/downloads/nagiosxi/docs/How-To-Configure-NRPE-and-Install-From-Source-with-Nagios-XI.pdfBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE check_cpu_stats unable to read, but other NRPE are
As of this moment it is for consistency with our automation. At this moment I am not seeing anything in the manual source compile that would affect this, also this issue arose even after removing the user and the local files and reinstalling. Same problem with the output.