Page 2 of 2

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Mon Dec 04, 2017 1:00 pm
by npolovenko
@bsivavani
Nondefault paths are because of we installed NRPE using rpm's.
Yes, I believe that's the main problem. Unfortunately, Nagios hasn't yet officially released rpm for NRPE 3.2.1. And because we haven't created that RPM we don't know how the paths were configured. Your best bet would be to go line by line and compare NRPE configs that you have to the corresponding paths on your system.
Cannot write to pidfile '/etc/nagios/nrpe.pid' - check your privileges.
Make sure that you do have /etc/nagios folder on your system. If you don't please create it:

Code: Select all

mkdir /etc/nagios/
After that assign the permissions:

Code: Select all

chown nagios:nagios /etc/nagios/
chown +x /etc/nagios/
Finally, please restart NRPE with:

Code: Select all

service nrpe restart

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Tue Dec 05, 2017 4:05 am
by bsivavani
/etc/nagios already have 777 permissions.

We are planning to install NRPE using rpm's.

Can you let us know what is the official latest release rpm for NRPE ?

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Tue Dec 05, 2017 6:57 am
by bsivavani
FYI.. We are using rpm package of version 3.2.0.

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Tue Dec 05, 2017 1:51 pm
by cdienger
The permissions error is interesting. Does su nagios touch /etc/nagios/nrpe.pid work? Is there nagios user and group in /etc/passwd and /etc/group ?

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Wed Dec 06, 2017 6:55 am
by bsivavani
Created the nrpe.pid file using touch, but still seeing the same permission issue.

[root@s93tl3101 system]# cat /etc/group | grep nagios
nagios:x:1002:nrpe
[root@s93tl3101 system]#
[root@s93tl3101 system]# cat /etc/passwd | grep nagios
nagios:x:1002:1002::/home/nagios:/bin/bash
[root@s93tl3101 system]#

Can you let us know what is the latest rpm file which Nagios officially supporting ?

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Wed Dec 06, 2017 12:08 pm
by npolovenko
@bsivavani, I want to make a correction to my previous post. I spoke with a team and actually, we don't have official rpm's for nrpe. Generally, we try to provide help with rpm's though.
I went ahead and started up a clean Centos 7x64, then I installed the epel-release rpm from the link that you provided:
http://dl.fedoraproject.org/pub/epel/7/ ... noarch.rpm
After that I ran:

Code: Select all

yum install nrpe
yum install nagios-plugins-all -y
I successfully installed nrpe agent and plugins and the nrpe daemon is now active.

I think you may have installed nrpe agent 2 times. First time using a regular install and that's why systemd daemon is starting, and the second time you actually installed it with the RPM, which uses nagios service. That's why the system can't assign the pid file to the nagios service because it's already in use by systemd.
My recommendation is to start all over, wipe the system if possible, or revert a VM to a previous snapshot.

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Thu Dec 07, 2017 7:15 am
by bsivavani
Hi,

We tried in fresh server and able to run the nrpe using systemctl, but we are seeing below issue while running the CPU plugin.

/usr/local/nagios/libexec/check_nrpe -H lbXXXXX.rwest.local -t 30 -c check_cpu_stats1 -a "-Iw 20 -Ic 10"
OUTPUT: NRPE: Unable to read output


Plugin permissions
[root@givemeaname plugins]# ls -l /usr/lib64/nagios/plugins/check_cpu_stats1.sh
-rwxrwxrwx. 1 root root 14624 Mar 23 2016 /usr/lib64/nagios/plugins/check_cpu_stats1.sh
[root@givemeaname plugins]#

Attached nrpe.cfg file.

Kindly advice ?

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Thu Dec 07, 2017 10:18 am
by npolovenko
@bsivavani, Does the plugin work without nrpe with the supplied arguments?

Code: Select all

cd /usr/lib64/nagios/check_cpustats1.sh 
./check_cpu_stats1 -Iw 20 -Ic 10
Do other plugins work fine? Let's test the nrpe connection:
On Nagios server please navigate to:
/usr/local/nagios/libexec/
and run:

Code: Select all

./check_nrpe -H lbXXXXX.rwest.local 
*Replace the host value with the correct one.

Now, as far arguments go, please try the the following command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H lbXXXXX.rwest.local -t 30 -c check_cpu_stats1 -a "-w 20 -c 10"
PS: Can you share a link to download this plugin?

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Fri Dec 08, 2017 5:37 am
by bsivavani
Hi,

After rebooting the server, we were able to get the output.

Thanks for your help.

Re: Install NRPE 3.2.1 on CentOS 7 server

Posted: Fri Dec 08, 2017 10:19 am
by tmcdonald
Great to hear! Mind if we close this up?