Page 1 of 2

NRPE agent installation on RHEL 7.2

Posted: Thu Dec 06, 2018 7:23 am
by RIDS_I2MP
Hi Team,

We have to monitor one Linux server version RHEL 7.2.
We have done NRPE installation using below document and it completed successfully.
https://assets.nagios.com/downloads/nag ... _Agent.pdf

The problem is we are not able to start the nrpe service, not sure what we have missed.
Request you to help us on this issue.

Thanks in advance!!

Re: NRPE agent installation on RHEL 7.2

Posted: Thu Dec 06, 2018 10:43 am
by amunter
On my RHEL 7 machines when I run the fullinstall script it puts the following file called "nrpe" into the /etc/xinetd.d/ directory:

Code: Select all

# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
    disable         = no
    per_source      = 25
    socket_type     = stream
    port            = 5666
    wait            = no
    user            = nagios
    group           = nagios
    server          = /usr/local/nagios/bin/nrpe
    server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
    only_from       = 127.0.0.1 192.168.1.100
    log_on_success  =
}
Is it possible that you have xinetd disabled?

Re: NRPE agent installation on RHEL 7.2

Posted: Thu Dec 06, 2018 1:02 pm
by npolovenko
Hello, @RIDS_I2MP. Could you clarify how you're checking whether nrpe is running? If it's running under xinetd you won't see nrpe in the list of processes, just the xinetd daemon.

Re: NRPE agent installation on RHEL 7.2

Posted: Thu Dec 06, 2018 1:06 pm
by amunter
I'm not the original poster. I was trying to help him out.

Re: NRPE agent installation on RHEL 7.2

Posted: Thu Dec 06, 2018 1:13 pm
by npolovenko
@amunter, My bad. I changed the name in the message.

Re: NRPE agent installation on RHEL 7.2

Posted: Fri Dec 07, 2018 5:13 am
by RIDS_I2MP
Hi Team,

We tried checking using ps -ef|grep -i nrpe command, we could not see nrpe running.

I have attached the errors here, please have a look at them.
If we are start the nrpe service using below command:
systemctl start nrpe.service

We are getting "could not completed SSL handshake error".

So we stopped it and now only xinetd is running, but we are getting "(Return code of 255 is out of bounds)" error.

[root@eu2xwbl026 xinetd.d]# ps -ef|grep -i nrpe
root 6394 5531 0 11:06 pts/0 00:00:00 grep --color=auto -i nrpe
[root@eu2xwbl026 xinetd.d]# ps -ef|grep -i xinetd
root 3687 1 0 Dec06 ? 00:00:00 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid
root 6403 5531 0 11:06 pts/0 00:00:00 grep --color=auto -i xinetd
[root@eu2xwbl026 xinetd.d]#


Please let me know if you need any details, we would be happy to provide.

Re: NRPE agent installation on RHEL 7.2

Posted: Fri Dec 07, 2018 12:16 pm
by lmiltchev
Is your firewall blocking port 5666?

What is the output of the following command, run on the client machine?

Code: Select all

iptables -nL
Is 10.147.108.45 the IP address of your Nagios XI server?

Restart xinetd on the remote machine:

Code: Select all

systemctl restart xinetd.service
then run the following commands on the Nagios XI server and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip>
nmap <client ip> -p 5666

Re: NRPE agent installation on RHEL 7.2

Posted: Mon Dec 10, 2018 5:42 am
by RIDS_I2MP
Hello,

PFB the details:

Client server: 10.146.207.6 (EU2XAPL060)
Nagios sever: 10.147.108.45

I have attached the nrpe.cfg here.

Commands and output:
[nagios@EU2XAPL060 etc]$ iptables -nL
iptables v1.4.21: can't initialize iptables table `filter': Permission denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
[nagios@EU2XAPL060 etc]$


[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/check_nrpe -H 10.146.207.6
CHECK_NRPE: Error - Could not connect to 10.146.207.6: Connection reset by peer
[nagios@EU2XAPL060 etc]$


[nagios@EU2XAPL060 etc]$ nmap 10.146.207.6 -p 5666
-bash: nmap: command not found
[nagios@EU2XAPL060 etc]$

Re: NRPE agent installation on RHEL 7.2

Posted: Mon Dec 10, 2018 5:45 am
by RIDS_I2MP
Hello,

I also ran below commands that I found from previous Nagios topics. Please check and let me know where we are missing out something.

[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/cpu_ent -w 500 -c 600
-bash: /usr/local/nagios/libexec/cpu_ent: No such file or directory
[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/check_services -p xntpd
*** xntpd: Nok ***
[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/check_services -p syslogd
syslogd: 1
[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/check_services -p errdemon
*** errdemon: Nok ***
[nagios@EU2XAPL060 etc]$ /usr/local/nagios/libexec/check_services -p cron
cron: 1
[nagios@EU2XAPL060 etc]$ echo $SHELL
/bin/bash
[nagios@EU2XAPL060 etc]$ which sh
/usr/bin/sh
[nagios@EU2XAPL060 etc]$ which bash
/usr/bin/bash
[nagios@EU2XAPL060 etc]$ which ksh
/usr/bin/which: no ksh in (/home/nagios/perl5/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/nagios/.local/bin:/home/nagios/bin)
[nagios@EU2XAPL060 etc]$ head -1 /usr/local/nagios/libexec/check_services
#!/bin/bash
[nagios@EU2XAPL060 etc]$ sh /usr/local/nagios/libexec/check_services -p cron
cron: 1
[nagios@EU2XAPL060 etc]$

Re: NRPE agent installation on RHEL 7.2

Posted: Mon Dec 10, 2018 3:48 pm
by tgriep
Can you run the following on the remote server as root and post the output to the ticket?

Code: Select all

netstat -anp |grep 5666
systemctl restart nrpe
systemctl status nrpe
Your ps output show that you could have another NRPE agent installed on the server so can you run this command as root to remove it.

Code: Select all

yum remove nrpe
Then, reinstall NRPE using the Linux Agent Installer document from your first post and see if it installs and runs this time.