How to Add Linux Host to Nagios Monitoring Server Using NRPE Plugin

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

460 Responses

  1. Marcus Coleman says:

    Hi Ravi

    Great Article and tutorial!

    I need your help!
    I have 50 host that I want to add to Nagios for monitoring.
    I am correct to say that I must add 50 host entries to the /usr/local/nagios/etc/hosts.cfg and 250 (50 x5) entries in the /usr/local/nagios/etc/services.cfg file?

    I completely understand the benefit once it is configured but is there a better way?

    thanks in advance for you help

    • Ravi Saive says:


      I understand the pain of adding those 50 server to those Nagios configuration files, but this is the only option….

  2. Aleks P says:

    Hi, thanks for the tutorial.

    I have an error when i try to verify my nagios.cfg file though.

    It says, template generic_servce specified in service definition could not be found (config file /usr/local/nagios/etc/services.cfg) also i can run nagios on the web but when i try to click lets say…services it says that Error: Could not read object configuration data!, I am assuming because the config file is wrong.


    • Ravi Saive says:


      Have you created services.cfg file under /usr/local/nagios/etc/ and added the entry in nagios.cfg file? if yes, could you share the services.cfg file entries with us? let me take a look and give you a proper solution..

  3. satish says:

    Hi, I am not able to find below file… what I am missing here ? :-(

    Now open /etc/xinetd.d/nrpe file and add the localhost and IP address of the Nagios Monitoring Server.

  4. Jose Mantilla says:

    Nice tutorial, unfortunately, there is some mistakes due to versions, I have executed all the steps with Centos 7.3 and clients centos 6.8, the complete solution and steps for whetever linux distro is:

    • Ravi Saive says:


      Thanks for finding this article useful, yes there were some mistakes even I faced for NRPE version 3.0 during my setup on CentOS 7.2 and CentOS 6.8, will modify and add the correct steps for nrpe 3.0 source installation..

  5. casper says:

    [[email protected] nrpe-3.0]# make install-inetd
    No inetd file to install
    make: *** [install-inetd] Error 1
    Hello I encountered this problem, ask where the problem lies

  6. Vijay Thankur says:

    Thanks for Sharing nagios is working cool.
    if i have to add multiple hosts for monitoring ? so we need to add continues adding in this file ? /usr/local/nagios/etc/services.cfg

  7. Kool says:

    Hi Ravi,

    I successfully configured the nagios server, but facing problem with Nrpe3.0, so I went with Nrpe2.14 version, but again ./configure stopped at SSL headers Error.

    To sort this out I proceeded with installation of Openssl-devel package through yum, but that also failed seeking dependencies. And dependencies also need more dependencies which creates chain of packages to be installed.

    Would be grateful to you if you could suggest some alternatives.

    • Ravi Saive says:


      The error is clear that you don’t have SSL headers installed on the system and that can be fixed installing:

      yum install openssl-devel
  8. Siranjeevi says:


    I am facing below error, while installing npre deamon.

    # make install-daemon-config
    make: *** No rule to make target `install-daemon-config’. Stop.

    • Ravi Saive says:


      Did you installed needed gcc libraries? if not install them using:

      # yum groupinstall " Development Tools"
      • Ankit Sharma says:

        Hi Ravi,

        I was following the instructions the to run make install-deamon-config after running the yum groupinstall “Development Tools” and after doing that when i run make install-daemon-config commnad i am having the same output:

        make: *** No rule to make target `install-daemon-config’. Stop.

        due to this i am not able to see /etc/xientd.d/nrpe file to add the nagios host IP

        Please suggest.


        • Randeep Singh says:

          Ravi, I am also getting the same error even after installing “Development Tools”.

          Its been 3 days, now i am loosing hope ..Please Help,if you can…Thanks

          • Randeep Singh says:

            I also want to mention here the O.P. of “make install-plugin” & “make install-daemon”
            > showing “make[1]: Leaving directory `/root/nagios/nrpe-3.0/src'”
            is it OK to have this in O.P.

            #make install-plugin
            cd ./src/; make install-plugin
            make[1]: Entering directory `/root/nagios/nrpe-3.0/src'
            /usr/bin/install -c -m 755 -d /usr/local/nagios/bin
            /usr/bin/install -c -m 755 ../uninstall /usr/local/nagios/bin/nrpe-uninstall
            /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
            /usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
            /usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec
            make[1]: Leaving directory `/root/nagios/nrpe-3.0/src'
            #make install-daemon
            cd ./src/; make install-daemon
            make[1]: Entering directory `/root/nagios/nrpe-3.0/src'
            /usr/bin/install -c -m 755 -d /usr/local/nagios/bin
            /usr/bin/install -c -m 755 ../uninstall /usr/local/nagios/bin/nrpe-uninstall
            /usr/bin/install -c -m 755 nrpe /usr/local/nagios/bin
            make[1]: Leaving directory `/root/nagios/nrpe-3.0/src'
            # make install-daemon-config
            make: *** No rule to make target `install-daemon-config'.  Stop.
          • Ravi Saive says:


            I think some issues with latest NRPE Plugin, give me a day let me check in my CentPS 7 box, and will get back to you with solution. Till, then I suggest you to use NRPE 2.x version and see..

          • Randeep Singh says:

            Thanks, Ravi for we appreciate this.

  9. Tom says:

    Has anyone found a somewhat simple way to add remote host service checks to Nagios server using automation (Chef, HTTP POST, etc.)? There are some ideas floating around, but haven’t been able to find what I need.

    • Zack says:

      What could be the simplest way than this ? I’ve created a bash script doing this by connecting to remote host and running the installation script

  10. abhishek kushwaha says:

    i m facing this error how can remove it and how can share my screen shot

    CHECK_NRPE: Socket timeout after 10 seconds.

    • Ravi Saive says:


      Socket timeout error related to your network connection, make sure there isn’t any network issues between two servers..

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *