Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Monitoring Tools»Nagios»How To Install NRPE on CentOS/RHEL 7/6

    How To Install NRPE on CentOS/RHEL 7/6

    RahulBy RahulOctober 12, 20173 Mins ReadUpdated:November 10, 2017

    NRPE is ‘Nagios Remote Plugin Executor‘. NRPE allows Nagios server to remotely execute plugins/commands on Linux/Unix machines and get the result back of the executed command. NRPE is also available with some windows add-ons to monitor windows servers. This article will help you to install NRPE on your CentOS/RHEL 7/6 Systems, which needs to monitor through nagios server.

    Step 1 – Install EPEL Repository

    NRPE packages and plugins are available under EPEL yum repository, Enable EPEL repository using one of below commands.

    ### On CentOS/RHEL - 7 ###
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
    
    ### On CentOS/RHEL - 6 ###
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    

    Step 2 – Install NRPE and Nrpe-plugins

    After enabling EPEL repository, use following commands to install NRPE and plugins in your system.

    yum --enablerepo=epel -y install nrpe nagios-plugins
    

    We also need to install commands which NRPE executes for monitoring services. Use the following command to get a list of available commands packages. Install the required packages on your remote system.

    yum --enablerepo=epel -y list nagios-plugins*
    
    Installed Packages
    nagios-plugins.x86_64                      2.2.1-4git.el7     @epel
    Available Packages                                          
    nagios-plugins-all.x86_64                  2.2.1-4git.el7     epel
    nagios-plugins-apt.x86_64                  2.2.1-4git.el7     epel
    nagios-plugins-bacula.x86_64               5.2.13-23.1.el7    base
    nagios-plugins-bonding.x86_64              1.4-3.el7          epel
    nagios-plugins-breeze.x86_64               2.2.1-4git.el7     epel
    nagios-plugins-by_ssh.x86_64               2.2.1-4git.el7     epel
    nagios-plugins-check-updates.x86_64        1.6.18-2.el7       epel
    nagios-plugins-cluster.x86_64              2.2.1-4git.el7     epel
    nagios-plugins-dbi.x86_64                  2.2.1-4git.el7     epel
    nagios-plugins-dhcp.x86_64                 2.2.1-4git.el7     epel
    nagios-plugins-dig.x86_64                  2.2.1-4git.el7     epel
    nagios-plugins-disk.x86_64                 2.2.1-4git.el7     epel
    nagios-plugins-disk_smb.x86_64             2.2.1-4git.el7     epel
    nagios-plugins-dns.x86_64                  2.2.1-4git.el7     epel
    [...]
    

    Step 3 – Configure NRPE

    First, we need to edit NRPE configuration file and start the configuration to work properly.

    vim /etc/nagios/nrpe.cfg
    

    Add your Nagios server ip with allowed_hosts like below, For example Nagio server ip is 192.168.1.110.

    allowed_hosts=127.0.0.1, 192.168.1.110
    

    After adding above entry you will see that Nagios server is able to connect NRPE client. Let add commands to monitor services. Add new commands or update existing commands like below in the same file.

    command[check_root_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
    command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
    

    You can add more commands like above as per requirement of monitoring.

    Step 4 – Start NRPE Service

    After making all changes, reboot NRPE once to read new configuration, Also configure NRPE to autostart on system boot.

    sudo systemctl enable nrpe.service
    sudo systemctl start nrpe.service
    

    Step 5 – Test NRPE from Nagios Server

    Login to Nagios server and execute the following command to verify that Nagios server is able to connect to clients NRPE services. On successful connection, it will show version of clients NRPE package. For example, your remote system IP is 192.168.1.20 with NRPE installed.

    check_nrpe -H 192.168.1.20
    
    NRPE v3.1
    
    Nagios NRPE NRPE NRPE using Yum
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Apache/PHP 7 on CentOS/RHEL 7.6/6.9 and Fedora 31/30
    Next Article How to Setup Apache with PHP/FastCGI on CentOS/RHEL 7/6

    Related Posts

    How to Install Nagios Client (NRPE) on Ubuntu 20.04

    3 Mins Read

    How to Install Nagios Server on Ubuntu 20.04

    Updated:June 3, 20213 Mins Read

    How To Install NRPE on LinuxMint 19/18

    Updated:December 6, 20182 Mins Read

    How to Monitor Memory, CPU and Disk on Linux using NRPE and Nagios

    Updated:January 11, 20183 Mins Read

    How to Create Own Nagios Plugin using Bash Shell Script

    Updated:December 1, 20172 Mins Read

    How to Install NRPE on Ubuntu 18.04 & 16.04 LTS

    Updated:June 3, 20213 Mins Read

    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

    Recent Posts
    • How To Install Docker on Ubuntu 22.04
    • How to Install Bower on Ubuntu 22.04 & 20.04
    • How to run “npm start” through Docker
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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