Page 1 of 1

NRPE installation on a nagios XI server

Posted: Wed Jul 19, 2017 4:09 am
by hgs
Hi
i have run into trouble getting NRPE. i have followed the document below

https://github.com/NagiosEnterprises/nr ... s/NRPE.pdf

i have no errors when i have run the install but running a test

Code: Select all

[root@hgsnagprd01 ~]# netstat -at | grep "nrpe|5666"
[root@hgsnagprd01 ~]#

Code: Select all

[root@hgsnagprd01 ~]# /usr/local/nagios/libexec/check_nrpe -H 10.1.62.240
connect to address 10.1.62.240 port 5666: Connection refused
connect to host 10.1.62.240 port 5666: Connection refused

Code: Select all

[root@hgsnagprd01 ~]# nmap 10.1.62.240 -p 5666

Starting Nmap 6.47 ( http://nmap.org ) at 2017-07-19 09:50 BST
Nmap scan report for 10.1.62.240
Host is up (0.000041s latency).
PORT     STATE  SERVICE
5666/tcp closed nrpe

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
[root@hgsnagprd01 ~]#

Code: Select all

[root@hgsnagprd01 ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:80
6    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:443
7    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           state NEW udp dpt:162
8    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
9    ACCEPT     tcp  --  10.1.62.240          0.0.0.0/0           tcp dpt:5666 state NEW,ESTABLISHED

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

[root@hgsnagprd01 ~]#

Code: Select all

[root@hgsnagprd01 ~]# service xinetd status
xinetd (pid  16842) is running...
[root@hgsnagprd01 ~]#

the documentation tells me i should get the following
nrpe test.PNG

Code: Select all

[root@hgsnagprd01 ~]# vim /etc/services
nrpe test 01.PNG

Code: Select all

[root@hgsnagprd01 ~]# cat /etc/xinetd.d/nrpe
# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
    disable         = yes
    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 10.1.62.240
    log_on_success  =
}
[root@hgsnagprd01 ~]#
the nagios xi server is 10.1.62.240
nrpe test 02.PNG

Code: Select all

[root@hgsnagprd01 ~]# /usr/local/nagios/libexec/check_nrpe -H localhost
connect to address ::1 port 5666: Connection refused
connect to address 127.0.0.1 port 5666: Connection refused
connect to host localhost port 5666: Connection refused
[root@hgsnagprd01 ~]#
hope i have provided enough information as this is all very new to me
Any help would be much appreciated the end goal is to check a remote MegaRAID. with the check_megaraid_sas
https://exchange.nagios.org/directory/P ... as/details
https://exchange.nagios.org/directory/P ... v2/details

Re: NRPE installation on a nagios XI server

Posted: Wed Jul 19, 2017 1:51 pm
by tgriep
The NRPE Agent's xinetd.d configuration file is setup to not run because of this option.

Code: Select all

disable         = yes
Edit the /etc/xinetd.d/nrpe file and change the following from

Code: Select all

disable         = yes
to

Code: Select all

disable         = no
Save and restart xinetd by running

Code: Select all

service xinetd restart
And after the change, the NRPE Agent should be able to run.

Re: NRPE installation on a nagios XI server

Posted: Thu Jul 20, 2017 3:14 am
by hgs
thanks for the response.
i have name the change and tried again
it works.
was so focused on a firewall rules i missed this. didn't think it was disabled as the service state was showing as running.

Re: NRPE installation on a nagios XI server

Posted: Thu Jul 20, 2017 9:45 am
by bolson
May we go ahead and close this topic?