NRPE agent installation on RHEL 7.2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

NRPE agent installation on RHEL 7.2

Post 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!!
Thanks & Regards,
I2MP Team.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: NRPE agent installation on RHEL 7.2

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

Re: NRPE agent installation on RHEL 7.2

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amunter
Posts: 33
Joined: Wed Aug 01, 2018 1:08 pm

Re: NRPE agent installation on RHEL 7.2

Post by amunter »

I'm not the original poster. I was trying to help him out.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: NRPE agent installation on RHEL 7.2

Post by npolovenko »

@amunter, My bad. I changed the name in the message.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: NRPE agent installation on RHEL 7.2

Post 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.
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NRPE agent installation on RHEL 7.2

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: NRPE agent installation on RHEL 7.2

Post 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]$
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: NRPE agent installation on RHEL 7.2

Post 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]$
Thanks & Regards,
I2MP Team.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE agent installation on RHEL 7.2

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked