How to Install NRPE from EPEL on Centos / RHEL 6

On the client

Install EPEL repository

Red Hat 6

rpm -ivh


yum install epel-release

Install requires packages

yum install nrpe nagios-plugins-all openssl

Add the Nagios server IP

vi /etc/nrpe.d/allowed_hosts.cfg


/etc/init.d/nrpe start

Add HTTP service

vi /etc/nagios/nrpe.cfg

command[check_http]=/usr/lib64/nagios/plugins//check_http -I

/etc/init.d/nrpe restart

Configure iptables

vi /etc/sysconfig/iptables

-A INPUT -s -m state --state NEW -m tcp -p tcp --dport 5666 -j ACCEPT

vi /init.d/iptables restart

On nagios server

Install NRPE plugin

yum install nagios-plugins-nrpe

Create the directory

mkdir /etc/nagios/servers

Edit nagios configuration file

vi /etc/nagios/servers


Add check_nrpe command

vi /etc/nagios/objects/commands.cfg

define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

Create the hostgroup

vi /etc/nagios/servers/hostgroups.cfg

define hostgroup{
        hostgroup_name  linux-servers
        alias           Linux Servers
        members         client

Create the configuration for client

vi /etc/nagios/servers/client.cfg

define host{
        use                     linux-server
        host_name               client
        alias                   client
        hostgroups              linux-servers

define service{
        use                             local-service
        host_name                       client
        service_description             HTTP
        check_command                   check_nrpe!check_http
        notifications_enabled           0

Check configuration

/etc/init.d/nagios checkconfig

Restart nagios

/etc/init.d/nagios restart

Test the connection

/usr/lib64/nagios/plugins/check_nrpe -H -c check_http