Install NRPE 3.2.1 on CentOS 7 server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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 ?
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post by bsivavani »

FYI.. We are using rpm package of version 3.2.0.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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 ?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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 ?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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 ?
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Install NRPE 3.2.1 on CentOS 7 server

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
bsivavani
Posts: 339
Joined: Tue Oct 06, 2015 9:17 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post by bsivavani »

Hi,

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

Thanks for your help.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Install NRPE 3.2.1 on CentOS 7 server

Post by tmcdonald »

Great to hear! Mind if we close this up?
Former Nagios employee
Locked