Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Monitoring Tools»Nagios»How To Install NRPE on CentOS/RHEL 9/8/7

    How To Install NRPE on CentOS/RHEL 9/8/7

    By RahulFebruary 8, 20232 Mins Read

    NRPE (Nagios Remote Plugin Executor) is a Nagios plugin used to remotely execute plugins and scripts on remote hosts. This allows you to monitor resources, such as disk usage, CPU load, and network activity, on remote hosts. In this article, we will show you how to install NRPE on CentOS/RHEL 9/8.

    Advertisement

    Prerequisites

    Before installing NRPE, you must have the following prerequisites:

    • A server running CentOS/RHEL 9/8/7.
    • A user account with sudo or root privileges.
    • The yum package manager must be installed on your system.

    Step 1: Install NRPE Package

    To install the NRPE package, run the following command as root or with sudo privileges:

    sudo yum install nrpe nagios-plugins-nrpe -y 
    

    Step 2: Configure NRPE

    After the installation is complete, you need to configure NRPE. The NRPE configuration file is located at /etc/nagios/nrpe.cfg. Open the file using your favorite text editor and make the following changes:

    • Change the allowed_hosts directive to allow connections from your Nagios server. For example, if your Nagios server has an IP address of 192.168.1.100, you would add the following line to the configuration file:

      1
      allowed_hosts=192.168.1.100

    • Define the commands that NRPE will execute. The commands are defined in the command[ ] sections of the configuration file. For example, to define a command to check the load average on the remote host, you would add the following line to the configuration file:

      1
      command[check_root_disk]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /

    • Step 3: Start and Enable NRPE Service

      To start and enable the NRPE service, run the following commands:

      sudo systemctl start nrpe 
      sudo systemctl enable nrpe 
      

      Step 4: Test NRPE Configuration

      Finally, you can test the NRPE configuration by running the following command on your Nagios server:

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

      If the NRPE configuration is correct, the output should be similar to the following:

      Output
      NRPE v4.1.0

      Conclusion

      In this article, we showed you how to install NRPE on CentOS/RHEL 9/8. NRPE allows you to monitor resources on remote hosts from your Nagios server. With the steps outlined in this article, you should be able to install NRPE on your server and get started with monitoring your network.

    Nagios NRPE NRPE NRPE using Yum
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Install Nagios Client (NRPE) on Ubuntu 20.04

    Installing Nagios on Ubuntu

    How to Install Nagios Server on Ubuntu 20.04

    How To Install NRPE Client on Linux Mint

    View 6 Comments

    6 Comments

    1. hola on March 31, 2019 11:22 am

      service nrpe restart is not runing giving error

      Authorization not available. Check if polkit service is running or see debug message for more information.
      Failed to restart nrpe.service: Unit not found.

      please suggest.

      Reply
    2. ArunPrakash Sargunam on February 6, 2019 10:38 am

      Hi Rahul,

      Is there any nagios plugin for get client servers /root/.bash_history ‘s file details. And it should to be append further command line activities.

      Reply
    3. Rusty on October 23, 2017 7:46 pm

      For adding the epel repository you give a command that calls a specific version of the rpm file. Once they update to a later version of the rpm file that current version is gone. They have a different link that will bring down the current version (no matter what version it is) and so the command works all the time. Well it is specific for like RH 6 or RH 7. That threw me for a loop for a bit when it would not run.

      rpm -Uhv http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

      Reply
      • Rahul K. on October 24, 2017 4:39 am

        Thanks Rusty, Tutorial has been updated with latest packages.

        Reply
    4. Hendrix on January 8, 2015 7:46 pm

      Error please help me

      Starting nrpe (via systemctl): Job for nrpe.service failed. See ‘systemctl status nrpe.service’ and ‘journalctl -xn’ for details. [FAILED]

      Follow all steps and when start service return error

      Tks!

      Reply
      • Dan Lund on February 10, 2016 6:33 pm

        Did you run”systemctl status nrpe.service” and “journalctl -xn” for details?

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.