Chapter 4. Configuring the remote node on the Nagios Core server


Configure the Nagios Core server to be aware of the remote hosts.

Prerequisites

  • Root-level access to the remote node on the Nagios Core server.
  • Internet access.

Procedure

  1. Install the check_nrpe plug-in:

    Example

    [root@nagios ~]# cd ~
    [root@nagios ~]# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.3/nrpe-4.0.3.tar.gz
    [root@nagios ~]# tar xvfz nrpe-4.0.3.tar.gz
    [root@nagios ~]# cd nrpe-4.0.3
    [root@nagios nrpe-4.0.3]# ./configure
    [root@nagios nrpe-4.0.3]# make check_nrpe
    [root@nagios nrpe-4.0.3]# make install-plugin
    Copy to Clipboard Toggle word wrap

  2. Create a configuration for the remote host:

    Syntax

     cd /usr/local/nagios/etc/objects
     cp localhost.cfg HOST_TO_ADD.cfg
    Copy to Clipboard Toggle word wrap

    Example

    [root@nagios nrpe-4.0.3]# cd /usr/local/nagios/etc/objects
    [root@nagios objects]# cp localhost.cfg host01.cfg
    Copy to Clipboard Toggle word wrap

  3. Edit the configuration file and update the settings for the remote host:

    Syntax

    vi HOST_TO_ADD.cfg
    Copy to Clipboard Toggle word wrap

    Example

    [root@nagios objects]# vi host01.cfg
    Copy to Clipboard Toggle word wrap

    Syntax

    # Define a host for the local machine
    
    define host {
    
        use     linux-server    ; Name of host template to use
                                ; This host definition will inherit all variables that are defined
                                ; in (or inherited by) the linux-server host template definition.
        host_name               LOCALHOST
        alias                   LOCALHOST
        address                 127.0.0.1
    }
    Copy to Clipboard Toggle word wrap

    Replace LOCALHOST with the hostname of the remote host, and 127.0.0.1 with the IP address of the Ceph monitor host.

    Example

    # Define a host for the local machine
    
    define host {
        use     linux-server   ; Name of host template to use
                               ; This host definition will inherit all variables that are defined
                               ; in (or inherited by) the linux-server host template definition.
        host_name               host01
        alias                   host01
        address                 10.10.128.69
    }
    Copy to Clipboard Toggle word wrap

  4. Delete or comment out the Host Group definition:

    Example

    [root@nagios objects]# vi host01.cfg
    Copy to Clipboard Toggle word wrap

    #define hostgroup {
    #
    #    hostgroup_name          linux-servers           ; The name of the hostgroup
    #    alias                   Linux Servers           ; Long name of the group
    #    members                 localhost               ; Comma separated list of hosts that belong to this group
    #}
    Copy to Clipboard Toggle word wrap
  5. Change the file ownership to Nagios:

    Example

    [root@nagios objects]# chown nagios:nagios host01.cfg
    Copy to Clipboard Toggle word wrap

  6. Add a cfg_file= reference to the host01.cfg file in /usr/local/nagios/etc/nagios.cfg:

    Example

    [root@nagios objects]# vi /usr/local/nagios/etc/nagios.cfg
    Copy to Clipboard Toggle word wrap

    cfg_file=/usr/local/nagios/etc/objects/host01.cfg
    Copy to Clipboard Toggle word wrap
  7. Restart the Nagios server:

    Example

    [root@nagios objects]# systemctl restart nagios
    Copy to Clipboard Toggle word wrap

  8. Ensure that the make and install procedures worked and that there is connectivity between the Nagios Core server and the remote host containing NRPE:

    Syntax

    /usr/local/nagios/libexec/check_nrpe -H HOSTNAME_OF_REMOTE_HOST
    Copy to Clipboard Toggle word wrap

    Replace HOSTNAME_OF_REMOTE_HOST with the IP address of the Ceph host to monitor.

    Example

    [root@nagios objects]# /usr/local/nagios/libexec/check_nrpe -H host01
    Copy to Clipboard Toggle word wrap

Verification

  • The check should echo NRPE v4.0.3 if it is working correctly.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat