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

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

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.45/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...

503 Responses

  1. David B says:

    What if I am installing a third server? How do I apply the service file I append the same info to the bottom and change the host name to new host but Nagios monitor display unknown services (NRPE: Unable to read output) for the service. The host was added fine.

    • Shyja SL says:

      Hi David,

      Try restart NRPE on remote client after the config changes:

      Command : /etc/init.d/nrpe restart (similar command)
      
  2. Shyja SL says:

    Hi,

    I have installed nagioscore-4.4.1, nagios-plugins-2.2.1 & nrpe-3.0.1 on my machine. Nagios Server is CentOS and Remote host is Suse Linux. I am getting error ‘CHECK_NRPE: Error – Could not connect to 10.211.7.5: Connection reset by peer

    • Ravi Saive says:

      @Shayja,

      Does it work with the localhost IP address (127.0.0.1)? If yes, might you need to disable IPv6 support. Another solution is, search for the following line in /etc/xinetd.d/nrpe file.

      "disable = yes"
      

      and simply change it to “no”, then:

      "disable = no"
      

      Restart the service.

      # systemctl restart xinetd.service
      # systemctl restart nrpe or # service nrpe restart (if not systemd)
      
      • Shyja SL says:

        Hi @Ravi Saive,

        Thanks for your reply. After the change I am getting the below error in Nagios Server.

        Output from Remote Client
        bhmlxab:/etc/rc.d # /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
        NRPE v3.0.1
        

        Output from Nagios Server

        [[email protected] objects]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
        CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).
        
  3. ashokkumar says:

    How to add hosts ipaddress and users in nagios server?

  4. Jagadeesh says:

    As i mentioned in my previous comment..

    connect to address ::1 port 5666: Connection refused
    connect to address 127.0.0.1 port 5666: Connection refused
    connect to host localhost port 5666: Connection refused
    

    I followed two methods

    1. I tried to open port for 5666 in iptables
    2. I disabled iptables and tried for sometime.

    but am getting same issues..

    • Ravi Saive says:

      @Jagadeesh,

      First verity that the port 5666 is running using following command.

      netstat -at | grep nrpe
      

      If not, you should check your NRPE installation…

  5. Jagadeesh says:

    connect to address ::1 port 5666: Connection refused
    connect to address 127.0.0.1 port 5666: Connection refused
    connect to host localhost port 5666: Connection refused

    • Ravi Saive says:

      @Jagadeesh,

      Please open the Nagio NRPE Port 5666 on firewall to allow connection from remote machines..

      • Jagadeesh says:

        I tried two things.

        1. I tried to open port for 5666 in iptables
        2. I disabled iptables and tried for sometime.

        I tried both but am getting same issues

        • Jagadeesh says:

          This tutorial is very very confusing, becuase which part will do at server and which will be do at remote machine is not clear.

          • Ravi Saive says:

            @Jagadeesh,

            If you know how Nagios works, you should clearly understand how these instructions works..

  6. Jagadeesh says:

    I can’t to install xinted in centos 6.10. Please anyone tell me.

    • Ravi Saive says:

      @Jagadeesh,

      It’s easy, just run the following command to install Xinetd on CentOS or Fedora.

      # yum install xinetd
      

Leave a Reply to ashokkumar Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.