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. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  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.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

390 Responses

  1. mukesh says:

    bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory

    I try to install nrpe plugin into nagios server. while installation no any coming error. when try to run below command
    /usr/local/nagios/libexec/check_nrpe -H 192.168.0.57(client IP). then coming error bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory. Please help me.

  2. mukesh says:

    bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory

    Please help me.

  3. Vivek Patil says:

    I am getting error when I ran /usr/local/nagios/libexec/check_nrpe -H localhost
    CHECK_NRPE: Error – Could not complete SSL handshake.

    • Ravi Saive says:

      @Vivek,

      Please check that you’ve added your Nagios Server IP address in nrpe.cfg file under Xinetd..

      • Mukesh says:

        Hi ,
        I installed nrpe at nagios server. install has been successful. but when i try to communicate with client host with below command
        /usr/local/nagios/libexec/check_nrpe -H 192.168.0.57

        then coming below massage. Please help me.
        /usr/local/nagios/libexec/check_nrpe: No such file or directory

        • Ravi Saive says:

          @Mukesh,

          It seems that your Nagios NRPE plugin installation was not successful, thats the reason you getting such error, I suggest you to try the installation again and see.

      • mukesh says:

        connect to address 192.168.0.121 port 5666: Connection refused

        • Ravi Saive says:

          @Mukesh,

          The error is clear that the connection id refusing, you need to open the port 5666 on the firewall to function properly..

  4. sandy says:

    Hello,

    When we install nagios agent in the client machine we will get lot of checks in the directory /usr/local/nagios/libexec and also few checks defined in the /etc/nrpe.cfg file right..

    But is it necessary to define these checks in the nrpe.cfg file??

    because there are only 7 predifined checks in my nrpe.cfg file and when I checked the front end Internet Explorer in the nagiosadmin I can see the graphical interface is showing 10 checks.

    I found out that these checks are defined in the nagios server for that host.

    I think we need only to define check in nrpe.cfg of the agent for custom checks..

    what is the difference between these two check mentioned below

    eximmail queue is custom check atnd is defined in the nrpe.cfg of agent. But check_http is not defined in the nrpe.cfg of agent…
    ==
    define service{
    use local-service ; Name of service template to use
    host_name harmonicland
    service_description HTTP
    check_command check_http
    notifications_enabled 0
    }

    define service{
    use local-service ; Name of service template to use
    host_name harmonicland
    service_description eximqueue
    check_command check_nrpe!check_eximqueue
    notifications_enabled 0
    }
    ====
    So i think we need to check

    • Ravi Saive says:

      @Sandy,

      Yes you 100% right, these nagios checks are installed under /usr/local/nagios/libexec and checks are defined in /etc/nrpe.cfg file, yes you can define your own checks in nrpe.cfg file under client machine.

  5. chandrakumar says:

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

    only_from = 127.0.0.1 localhost

    i don’t know the nagios ip address ,how can i find it?
    and the local host is mine or the one which created above (nagios)?

  6. Ashok says:

    Hi Ravi,
    Do we need to install NRPE and Nagios Plugins in both of the Nagios monitor server and remote linux system?

    • Ravi Saive says:

      @Ashok,

      NRPE and Nagios plugins in Nagios monitoring server and only NRPE plugin is enough on remote Linux server.

  7. Nagaraj says:

    Hi ,
    I’m adding four ubuntu host in the nagios server but all the four host showing same root partition and all the services

    • Ravi Saive says:

      @Nagaraj,

      Have you add all Ubuntu servers to Nagios hosts.cfg file? and defined services for these 4 servers in services.cfg file? also on each Ubuntu server in nrpe.cfg file have you defined proper root device name and all services? Please check these things first and confirm..

      • Nagaraj says:

        i done the following thing:
        1) vi /usr/local/nagios/etc/objects/localhost.cfg /usr/local/nagios/etc/objects/newhost.cfg

        2:edit the usr/local/nagios/etc/objects/newhost.cfg
        in HOST DEFINITION
        and change the hostname to newhost
        And same changes in

        SERVICE DEFINITIONS

        and save the file

        3) to add newhost in the /usr/local/nagios/etc/nrpe.cfg file also

        verify with /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

        no error

        where i did the mistake and where the hosts.cfg file located

        • Ravi Saive says:

          @Nagraj,

          Please follow the instructions carefully, you will know where is hosts.cfg and services.cfg file….

      • Nagaraj says:

        where hosts.cfg file is located & below find my steps

        1)copy localhost.cfg file to newhost.cfg

        and edit the newhost.cfg file and change the host name in the file to newhost and also i added the entry in the nrpe.cfg file also

  8. Balaraju says:

    @Ravi,

    I have installed client in ubuntu. i followed below link to install the nrpe in cleint.
    http://sharadchhetri.com/2013/06/11/how-to-install-and-configure-nagios-nrpe-client-in-ubuntu-with-apt-get-command/

    [root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xx.xxx
    NRPE v2.15
    [root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xx.xxx -c check_load
    OK – load average: 0.03, 0.08, 0.13|load1=0.030;15.000;30.000;0; load5=0.080;10.000;25.000;0; load15=0.130;5.000;20.000;0;

    but it is not displayed on console. We have added command also in /usr/local/nagios/etc/objects/command.cfg like below

    define command{
    command_name check_nrpe
    command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
    }

    define command{
    command_name check_load
    command_line /usr/local/nagios/libexec/check_load -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
    }

    • Ravi Saive says:

      @Balaraju,

      You should all add those check commands in remote nrpe.cfg file under /etc directory to display on the web..

  9. Balaraju says:

    Hi Team,

    I did all the configuration as above . But i am getting the error as below on console
    (No output on stdout) stderr: execvp(/usr/lib/nagios/plugins/check_nrpe, …) failed. errno is 2: No such file or directory

    • Ravi Saive says:

      @balaraju,

      Have you changed the default Nagios installation location? the default location for nagios-plugins source will be /usr/local/nagios/libexec, here all plugins installs. The error you getting seems you’ve chosen different location for nagios-plugins sources while compiling…

      • Vinod K says:

        I was also having the same problem, the solution which worked for me was renamed /usr/local/nagios/libexec to some temorary name /usr/local/nagios/libexec_temp and re-compile nrpe-2.15 which again created /usr/local/nagios/libexec/ folder with check_nrpe file, and then I moved all files within /usr/local/nagios/libexec_temp directory to /usr/local/nagios/libexec/

        I hope this helps, thanks :-)

    • Vinod K says:

      Very nice article, I was able to setup Nagios host & multiple servers monitor fairly quickly, since this article is a bit old I used some latest available softwares, e.g nagion-4.1.1, nagios plugins-2.1.1

      • Ravi Saive says:

        @Vinod,

        Yes, this article is a bit old, but I am in process of updating it to most recent version, just give me some time to prepare, test and implement it..

Got something to say? Join the discussion.

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

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's