Page 1 of 1

how to verify if linux nrpe agent is running?

Posted: Tue Sep 19, 2017 2:38 pm
by ikekim
How do I verify if the Linux NRPE agent is running on the Centos 7.x machine that is being monitored?

And how do I modify the "allow" IP address for the NagiosXI Server because I have installed NagiosXI on a different server?


thanks,
ik.

Re: how to verify if linux nrpe agent is running?

Posted: Tue Sep 19, 2017 3:45 pm
by dwasswa
Hi @ikekim,

To check if NRPE is running , run the command

Code: Select all

service nrpe status
And to modify allow IP on the nagios xi server you will have to go to nrpe configuration file
cd
like so..

Code: Select all

/usr/local/nagios/etc/nrpe.cfg
Look for this line

Code: Select all

allowed_hosts=127.0.0.1
and then add your IP like so...

Code: Select all

allowed_hosts=127.0.0.1,<IP address>

Re: how to verify if linux nrpe agent is running?

Posted: Thu Sep 21, 2017 2:18 pm
by ikekim
Hi dwasswa ,

the command doesn't tell me if the service is running.

[root@centos-min2 ~]# service nrpe status
Redirecting to /bin/systemctl status nrpe.service
Unit nrpe.service could not be found.

I also looked at the /usr/local/nagios/etc/nrpe.cfg , but interestingly, I don't see the original INagios XI P address which the install script prompted for me to eneter.


thank,
ik

Re: how to verify if linux nrpe agent is running?

Posted: Thu Sep 21, 2017 2:35 pm
by lmiltchev
Most probably NRPE is running under xinetd. You can view the nrpe config by running:

Code: Select all

cat /etc/xinetd.d/nrpe
Try:

Code: Select all

service xinetd status
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1

Re: how to verify if linux nrpe agent is running?

Posted: Mon Oct 02, 2017 9:55 am
by ikekim
I tried:

Code: Select all

cat /etc/xinetd.d/nrpe
and it returned:
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
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
log_on_failure += USERID
disable = no
only_from = 49.27.73.92
}

So in following your instructions I have to modify the line "only_from = new ip address"?

If yes, can I add multiple IP addresses in case I'm using more than one Nagios XI Server?

thanks.

Re: how to verify if linux nrpe agent is running?

Posted: Mon Oct 02, 2017 11:13 am
by dwasswa
Yes,you can add multiple IP addresses.

Re: how to verify if linux nrpe agent is running?

Posted: Mon Oct 02, 2017 12:43 pm
by ikekim
Sorry I got to ask in what format do I need to provide the multiple IP addresses?

Are the values separated by space, comma, semi colon, etc?

example of multiple ip addresses(Nagio XI servers) like this ?

only_from = 192.168.1.10, 192.168.9.11


thanks.

Re: how to verify if linux nrpe agent is running?

Posted: Mon Oct 02, 2017 12:54 pm
by npolovenko
@ikekim They need to be separated by space, no commas in-between.

Code: Select all

only_from = 192.168.1.10 192.168.9.11
After modifying /etc/xinetd.d/nrpe file, restart your nrpe by running

Code: Select all

service xinetd restart
.
Let us know if that worked.