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

In the first part of the Nagios series article, we’ve explained in detail how to install and configure the latest version of Nagios Core and Nagios Plugins in RHEL-based distributions such as CentOS Stream, Rocky Linux, AlmaLinux, and Fedora.

In this article, we will show you how to add a Remote Linux machine and its services to the Nagios Core Monitoring host using NRPE (Nagios Remote Plugin Executor) agent.

We hope you already have Nagios Core installed and running properly. If not, please use the following installation guide to install it on the system.

If you are planning to add a remote Windows host to the Nagios monitoring server, use the following guide:

Once you’ve installed it, you can proceed further to install the NRPE agent on your Remote Linux host. Before heading further, let us give you a short description of NRPE.

What is NRPE?

The NRPE (Nagios Remote Plugin Executor) plugin allows you to monitor any remote Linux/Unix services, network devices, or resources like CPU load, Swap, Memory usage, Online users, etc. on local/remote Linux machines.

After all, these local resources are not mostly exposed to external machines, an NRPE agent must be installed and configured on the remote machines.

Note: The NRPE addon requires that Nagios Plugins must be installed on the remote Linux machine. Without these, the NRPE daemon will not work and will not monitor anything.

Installation of NRPE Plugin in Nagios Server and Remote Linux Host

To use the NRPE, you will need to do some additional tasks on both the Nagios Monitoring Server and the Remote Linux Host that the NRPE is installed on. We will be covering both installation parts separately.

Installing Nagios Plugins and NRPE On Remote Linux Host

Please use the below instructions to install Nagios Plugins and NRPE daemon on the Remote Linux Host.

Step 1: Install Required Dependencies

We need to install required libraries like gcc, glibc, glibc-common, and GD and its development libraries using the yum package manager.

# yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel tar wget
Step 2: Create Nagios User

Create a new nagios user account and set a password.

# useradd nagios
# passwd nagios
Step 3: Install the Nagios Plugins

Create a directory for nagios plugin installation and all its future downloads.

# mkdir /root/nagios
# cd /root/nagios

Now download the latest Nagios Plugins package with the wget command.

# wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
Step 4: Extract Nagios Plugins

Run the following tar command to extract the source code tarball.

# tar -xvf nagios-plugins-2.3.3.tar.gz

After, extracting one new folder will appear in that directory.

# ls -l

total 2724
drwxr-xr-x. 15 root root    4096 Mar 11  2020 nagios-plugins-2.3.3
-rw-r--r--.  1 root root 2782610 Mar 11  2020 nagios-plugins-2.3.3.tar.gz
Step 5: Compile and Install Nagios Plugins

Next, compile and install nagios plugins using the following commands

# cd nagios-plugins-2.3.3
# ./configure 
# make
# make install

Set the permissions on the plugin directory using the chown command.

# chown nagios.nagios /usr/local/nagios
# chown -R nagios.nagios /usr/local/nagios/libexec
Step 6: Installing NRPE Plugin

To install the nrpe plugin, first, download the latest NRPE Plugin or use the following wget command.

# cd /root/nagios
# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.2/nrpe-4.0.2.tar.gz

Unpack the NRPE source code tarball.

# tar xzf nrpe-4.0.2.tar.gz
# cd nrpe-4.0.2

Compile and install the NRPE addon.

# ./configure
# make all

Note: If you get the following error while running the ‘make all‘ command:

In file included from ../include/common.h:34,
                 from ./nrpe.c:38:
/usr/include/openssl/err.h:413:15: note: declared here
  413 | unsigned long ERR_get_error_line_data(const char **file, int *line,
      |               ^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccWQBjHb.o: in function `init_ssl':
/root/nagios/nrpe-4.0.2/src/./nrpe.c:474: undefined reference to `get_dh2048'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:48: nrpe] Error 1

Then, you need to disable SSL for nrpe configuration with ./configure --disable-ssl flag as shown.

# ./configure --disable-ssl
# make all

Next, install the NRPE plugin daemon, and sample config files.

# make install-plugin
# make install-daemon
# make install-config

Install the NRPE daemon under systemd as a service.

# make install-init
Step 7: Configuring NRPE Plugin

Now open /usr/local/nagios/etc/nrpe.cfg file and add the local host and IP address of the Nagios Monitoring Server.

allowed_hosts=127.0.0.1,192.168.102

Next, enable and restart the nrpe service.

# systemctl enable nrpe
# systemctl restart nrpe
Step 8: Open NRPE Port in Firewall

Make sure that the Firewall on the local machine will allow the NRPE daemon to be accessed from remote servers. To do this, run the following iptables command.

# firewall-cmd --zone=public --add-port=5666/tcp
# firewall-cmd --zone=public --add-port=5666/tcp --permanent
Step 8: Verify NRPE Daemon Locally

Run the following netstat command to verify the NRPE daemon working correctly under systemd.

# netstat -at | grep nrpe
OR
# netstat -na | grep "5666"


tcp        0      0 0.0.0.0:nrpe            0.0.0.0:*               LISTEN     
tcp6       0      0 [::]:nrpe               [::]:*                  LISTEN 

If you get output similar to the above, means it working correctly. If not, make sure to check the following things.

  • Make sure to check that the nrpe entry is correctly added in the/etc/services file.
  • The allowed_hosts contains an entry for “nagios_ip_address” in the /usr/local/nagios/etc/nrpe.cfg file.
  • Check for the errors in the system log files for about nrpe and fix those problems.

Next, verify the NRPE daemon is functioning properly by running the “check_nrpe” command that was installed earlier for testing purposes.

# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1

You will get the following string on the screen, it shows you what version of NRPE is installed:

NRPE v4.0.2
Step 9: Customize NRPE Commands

The default NRPE configuration file that got installed has several command definitions that will be used to monitor this machine. The sample configuration file is located at.

# vi /usr/local/nagios/etc/nrpe.cfg

The following are the default command definitions that are located at the bottom of the configuration file. For the time being, we assume you are using these commands. You can check them by using the following commands.

# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_users

USERS OK - 1 users currently logged in |users=1;5;10;0
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_load

OK - load average: 3.90, 4.37, 3.94|load1=3.900;15.000;30.000;0; load5=4.370;10.000;25.000;0; load15=3.940;5.000;20.000;0;
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_hda1

DISK OK - free space: /boot 154 MB (84% inode=99%);| /boot=29MB;154;173;0;193
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_total_procs

PROCS CRITICAL: 297 processes
# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_zombie_procs

PROCS OK: 0 processes with STATE = Z

You can edit and add new command definitions by editing the NRPE config file. Finally, you’ve successfully installed and configured NRPE agent on the Remote Linux Host.

Now it’s time to install an NRPE component and add some services to your Nagios Monitoring Server

Installing NRPE On Nagios Monitoring Server

Now login into your Nagios Monitoring Server. Here you will need to do the following things:

  • Install the check_nrpe plugin.
  • Create a Nagios command definition using the check_nrpe plugin.
  • Create a Nagios host and add service definitions for monitoring the remote Linux host.
Step 1: Install NRPE Plugin in Nagios

Go to the nagios download directory and download the latest NRPE Plugin or use the following wget command.

# cd /root/nagios
# wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.0.2/nrpe-4.0.2.tar.gz

Unpack the NRPE source code tarball.

# tar xzf nrpe-4.0.2.tar.gz
# cd nrpe-4.0.2

Compile and install the NRPE addon.

# ./configure
# make all
# make install-plugin
# make install-daemon
# make install-init
Step 2: Verify NRPE Daemon Remotely

Make sure that the check_nrpe plugin can communicate with the NRPE daemon on the remote Linux host. Add the IP address in the command below with the IP address of your Remote Linux host.

# /usr/local/nagios/libexec/check_nrpe -H <remote_linux_ip_address>

You will get a string back that shows you what version of NRPE is installed on the remote host, like this:

NRPE v4.0.2

If your receive a plugin time-out error, then check the following things.

  • Make sure your firewall isn’t blocking the communication between the remote host and the monitoring host.
  • Make sure that the NRPE daemon is installed correctly under systemd.
  • Make sure that the remote Linux host firewall rules block the monitoring server from communicating with the NRPE daemon.

Adding Remote Linux Host to Nagios Monitoring Server

To add a remote host you need to create two new files “hosts.cfg” and “services.cfg” under the “/usr/local/nagios/etc/” location.

Step 1: Creating Nagios Host and Services File
# cd /usr/local/nagios/etc/
# touch hosts.cfg
# touch services.cfg

Now add these two files to the main Nagios configuration file. Open the nagios.cfg file with any editor.

# vi /usr/local/nagios/etc/nagios.cfg

Now add the two newly created files as shown below.

# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/services.cfg
Step 2: Configuring Nagios Host and Services File

Now open hosts.cfg file and add the default host template name and define remote hosts as shown below. Make sure to replace host_name, alias, and address with your remote host server details.

# vi /usr/local/nagios/etc/hosts.cfg
## Default Linux Host Template ##
define host{
name                            linux-box               ; Name of this template
use                             generic-host            ; Inherit default values
check_period                    24x7        
check_interval                  5       
retry_interval                  1       
max_check_attempts              10      
check_command                   check-host-alive
notification_period             24x7    
notification_interval           30      
notification_options            d,r     
contact_groups                  admins  
register                        0                       ; DONT REGISTER THIS - ITS A TEMPLATE
}

## Default
define host{
use                             linux-box               ; Inherit default values from a template
host_name                       tecmint		        ; The name we're giving to this server
alias                           CentOS 6                ; A longer name for the server
address                         5.175.142.66            ; IP address of Remote Linux host
}

Next open services.cfg file and add the following services to be monitored.

# vi /usr/local/nagios/etc/services.cfg
define service{
        use                     generic-service
        host_name               tecmint
        service_description     CPU Load
        check_command           check_nrpe!check_load
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     Total Processes
        check_command           check_nrpe!check_total_procs
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     Current Users
        check_command           check_nrpe!check_users
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     SSH Monitoring
        check_command           check_nrpe!check_ssh
        }

define service{
        use                     generic-service
        host_name               tecmint
        service_description     FTP Monitoring
        check_command           check_nrpe!check_ftp
        }
Step 3: Configuring NRPE Command Definition

Now NRPE command definition needs to be created in commands.cfg file.

# vi /usr/local/nagios/etc/objects/commands.cfg

Add the following NRPE command definition at the bottom of the file.

###############################################################################
# NRPE CHECK COMMAND
#
# Command to use NRPE to check remote host systems
###############################################################################

define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

Finally, verify Nagios Configuration files for any errors.

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Total Warnings: 0
Total Errors:   0

Finally, restart Nagios to apply recent configuration changes:

# systemctl restart nagios
Step 4: Monitoring Remote Linux in Nagios

Now go to the Nagios Monitoring Web interface at “http://Your-server-IP-address/nagios” or “http://FQDN/nagios” and Provide the username “nagiosadmin” and password. Check that the Remote Linux Host was added and is being monitored.

Monitoring Remote Linux Host in Nagios
Monitoring Remote Linux Host in Nagios
Conclusion

That’s it! for now, in my upcoming article, I will show you how to add a Windows host to Nagios monitoring Server. If you’re facing any difficulties while adding the remote host to Nagios.

Please do comment on your queries or problem via the comment section, till then stay tuned to Tecmint.com for more such valuable articles.

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

526 thoughts on “How to Add Linux Host to Nagios Monitoring Server Using NRPE Plugin”

  1. I got the following error while running the make all command.

    # make all
    
    ./nrpe.c:287:9: warning: ‘ENGINE_load_builtin_engines’ is deprecated: 
    Since OpenSSL 3.0 [-Wdeprecated-declarations]
      287 |         ENGINE_load_builtin_engines();
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    So I fixed it by using the latest version nrpe-4.1 from github:

    $ wget https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-4.1.0/nrpe-4.1.0.tar.gz
    
    Reply
  2. I am getting an error that says:

    “Redirecting to /bin/systemctl start nagios.service

    Job for nagios.service failed because the control process exited with an error code. See “systemctl status nagios.service” and “journalctl -xe” for details.”

    Reply
  3. Hello,

    I am administering our NAGIOS XI server (v5.5.9) and it is working fine and monitoring LINUX hosts with a variety of LINUX OS v7.9 and lower. This is my first use of CentOS8.x node in our environment and I’m unable to get the tools installed for monitoring using the steps outlined above.

    In my case, the verification in Step 8 fails —

    [root@servername tmp]# /usr/local/nagios/libexec/check_nrpe -H localhost
    CHECK_NRPE: Error - Could not connect to ::4c3a:433a:4b3a:413a: Connection reset by peer
    [root@servername tmp]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
    CHECK_NRPE: Error - Could not connect to 127.0.0.1: Connection reset by peer
    

    Also, I cannot verify the Step 10 “Customize NRPE Commands” file /usr/local/nagios/etc/nrpe.cfg because the directory /usr/local/nagios/etc/ is not installed.

    Any suggestions?

    Reply
  4. I need help, I just want to ask you if, the Nagios, Nagios-Plugins, NRPE, and Xinetd are installed in one machine or different?

    Reply
    • @Partik,

      Nagios is installed on the server machine, and Nagios-Plugins, NRPE, and Xinetd are installed on client machines…

      Reply
    • @Pratik,

      You must install Nagios-Plugins, NRPE, and Xinetd on a remote Linux host that you want to monitor under the Nagios server.

      Reply
  5. Dear Tecmit team,

    Why I am getting the below error while installing nrpe?

    [root@remotehost1 nrpe-nrpe-4.0.3]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config'.  Stop.
    
    Reply
  6. I was hoping to find a few more examples. I am trying to figure out how to check for specific processes running on my servers. For example, if I wanted to know if Firefox was running. How do you write a command_check to perform a ps -ef |grep -i firefox or something of the sort?

    Reply
  7. Tried this:

    # /usr/local/nagios/libexec/check_nrpe -H localhost
    

    and getting this error:

    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
    
    Reply
  8. # /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
    NRPE v3.2.1
    
    # /usr/local/nagios/libexec/check_nrpe -H 18.224.246.251
    CHECK_NRPE: Error - Could not connect to 18.224.246.251: Connection reset by peer
    
    Reply
  9. Hi,

    Good work but some errors while configuring the remote host.

    1) While installing nrpe the command given as shown below:

    [root@tecmint nagios]# tar xzf nrpe-3.2.1.tar.gz
    [root@tecmint nrpe-3.2]# cd nrpe-3.2
    

    I think it should be cd nrpe-3.2.1.

    2) I am getting an error while executing the below command.

    [root@tecmint nrpe-3.2]# make install-daemon-config
    [root@localhost nrpe-3.2.1]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config'.  Stop.
    
    Reply
  10. Hi, This error is coming while I am restarting the Nagios service for email configuration.

    [root@india objects]# service nagios restart
    

    Sample Output:

    Running configuration check... 
    Nagios Core 4.4.3
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 2019-01-15
    License: GPL
    
    Website: https://www.nagios.org
    Reading configuration data...
       Read main config file okay...
    Error: Template 'linux-server' specified in host definition could not be not found (config file '/usr/local/nagios/etc/objects/localhost.cfg', starting on line 21)
    Error: Service notification period '24×7' specified for contact 'nagiosadmin' is not defined anywhere!
    Error: Could not register contact (config file '/usr/local/nagios/etc/objects/contacts.cfg', starting on line 27)
       Error processing object config files!
    
    
    ***> One or more problems was encountered while processing the config files...
    
         Check your configuration file(s) to ensure that they contain valid
         directives and data definitions.  If you are upgrading from a previous
         version of Nagios, you should be aware that some variables/definitions
         may have been removed or modified in this version.  Make sure to read
         the HTML documentation regarding the config files, as well as the
         'Whats New' section to find out what has changed.
    Reply
  11. I want to know the meaning of this nagios status information as I am new to the Linux platform.

    HTTP WARNING: HTTP/1.1 404 – 1234 bytes in 0.004 second response time.

    Reply
  12. 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 hostname to a new host but the Nagios monitor displays unknown services (NRPE: Unable to read output) for the service. The host was added fine.

    Reply
    • Hi David,

      Try restarting NRPE on remote client after the config changes:

      Command : /etc/init.d/nrpe restart (similar command)
      
      Reply
  13. 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

    Reply
    • @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, to 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)
      
      Reply
      • 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.

        [root@YLASP150 objects]# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
        CHECK_NRPE: Receive header underflow - only -1 bytes received (4 expected).
        
        Reply
  14. 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 some time.

    but am getting the same issues…

    Reply
    • @Jagadeesh,

      First, verify that the port 5666 is running using the following command.

      # netstat -at | grep nrpe
      

      If not, you should check your NRPE installation…

      Reply
  15. I still get the same error:

    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
    
    Reply
      • I tried two things.

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

        I tried both but am getting the same issues.

        Reply
        • This tutorial is very very confusing because which part will do on the server and which will be done on the remote machine is not clear.

          Reply
          • @Jagadeesh,

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

  16. Getting this error, Kindly let me know what is the issue.

    /extinterface/southern_region/chpt/citpl/02/received/csv/: Does not exist  
    

    I have checked the permission and member of nagios user of port user

    Reply
  17. Hi bro, I added multiple Linux servers to Nagios server but all added server showing same "/" partition sizes and swap sizes, my partitions are created with LVM in all configuration files i modified “Hostname, alias, IPaddress“, is there any modifications i have to do?

    Reply
  18. How to remove the nrpe 3.2.1 setup from scratch in the client machine?

    I want to remove all the files & folders related nrpe and want make a fresh start. Assist me in it

    Reply
  19. [root@tlaserver21 nrpe-3.2.1]# /usr/local/nagios/libexec/check_nrpe -H localhost
    CHECK_NRPE: Error – Could not connect to ::1c00:0:ffff:ffff: Connection reset by peer

    Reply
  20. [root@server1 nagios]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
    
    Sample Output
    --2018-07-24 12:15:14--  http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
    Resolving liquidtelecom.dl.sourceforge.net... 197.155.77.8
    Connecting to liquidtelecom.dl.sourceforge.net|197.155.77.8|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://downloads.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
    --2018-07-24 12:15:16--  http://downloads.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.tar.gz
    Resolving downloads.sourceforge.net... 216.105.38.13
    Connecting to downloads.sourceforge.net|216.105.38.13|:80... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2018-07-24 12:15:18 ERROR 404: Not Found.
    

    can you please update the url of nrpe 3.0 plugin.

    Reply
  21. make: *** No rule to make target `install-daemon-config‘. Stop.
    You have new mail in /var/spool/mail/root
    [[email protected]]# make install-xinetd
    make: *** No rule to make target `install-xinetd’. Stop.
    [root@cloud86 nrpe-3.0]# make install-inetd
    No inetd file to install
    make: *** [install-
    getting above error

    Reply
    • @Rasmita,

      Please install all needed packages for Nagios to compile as shown.

      # yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd
      
      
      Reply				
          • Same issue here. There appears to be a missing step in the instructions. I’ve validated that all the listed packages are installed–my guess is that there is a package missing, and it is not listed in these instructions.

  22. I downloaded nrpe plugin tarball on nagios server and extracted it in /root/nagios/. Now when I am going inside that directory and running ./configure it is giving me these error. Can any one help me!!!

    checking for Kerberos include files... configure: WARNING: could not find include files
    checking for pkg-config... pkg-config
    checking for SSL headers... configure: error: Cannot find ssl headers
    
    Reply
    • @Partha,

      Please first install required libraries on your Linux distribution you are using.

      [root@tecmint]# yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel
      
      Reply
  23. $ sudo yum install gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd unzip
    

    this command shows:

    Loaded plugins: product-id, refresh-packagekit, subscription-manager
    Updating Red Hat repositories.
    Setting up Install Process
    No package gd available.
    No package gd-devel available.
    No package openssl-devel available.
    Nothing to do
    

    what it means?

    Reply
  24. Good day,

    I am stuck at extracting the file tar -xvf nagios-plugins-2.1.2.tar.gz, it only says

    gzip: stdin: not in gzip format
    tar: Child not returned status 1
    tar: Error is not recoverable: exiting now
    

    I already installed unzip, gzip and tar. Do you have any ideas on how to solve this?

    Reply
  25. Hi Ravi,

    A very basic question!!!

    I have installed Nagios on an EC2 instance and its up and running. But now when I try to access http://ec2-ip/nagios from my windows machine, I am unable to access it.

    I have configured port 80 for inbound rules in the security group still I am unable to access the web-interface.

    Reply
  26. Hi Ravi,

    I see two sets of configuration files, one set in /usr/local/nagios/etc and another in /etc/nagios/.

    Which one of them is picked? Am trying to add hostgroups to nagios but its not picking up the hosts information.

    Reply
  27. Hi Ravi,

    I have the same problem as Partha:

    [root@host nrpe-3.0]# 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’

    [root@host nrpe-3.0]# 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
    /usr/bin/install -c -m 755 -o nagios -g nagios -d /usr/local/nagios/var
    /usr/bin/install -c -m 644 ../startup/tmpfile.conf /usr/lib/tmpfiles.d/nrpe.conf
    make[1]: Leaving directory `/root/nagios/nrpe-3.0/src’

    #I guess problem starts here#

    [root@host nrpe-3.0]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config’. Stop.

    [root@host nrpe-3.0]# make install-xinetd
    make: *** No rule to make target `install-xinetd’. Stop.

    [root@host nrpe-3.0]# make install-inetd
    /usr/bin/install -c -m 644 startup/default-xinetd /etc/xinetd.d/nrpe
    ***** MAKE SURE ‘nrpe 5666/tcp’ IS IN YOUR /etc/services FILE

    Would appreciate your advice.

    Regards,

    Piotr

    Reply
    • Hi there,

      Used these instructions to setup NRPE and it KIND OF worked:
      https://support.nagios.com/kb/article.php?id=515

      I mean I got it running but now stumbled upon another problem and cannot find any solution anywhere.
      ———————

      [root@host init.d]# /usr/local/nagios/libexec/check_nrpe -H localhost
      CHECK_NRPE: Error – Could not connect to ::3668:6c6e:7556:0: Connection reset by peer

      [root@host init.d]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
      CHECK_NRPE: Error – Could not connect to ::3668:6c6e:7556:0: Connection reset by peer

      ————————
      HELP!

      Reply
      • 1) /usr/local/nagios/etc/nrpe.cfg must be present
        2)grep -i disable /etc/xinetd.d/nrpe
        disable = no
        3)If you don’t need IPv6 try disabling it in /etc/sysctl.conf
        # grep -i ipv6 /etc/sysctl.conf
        net.ipv6.conf.all.disable_ipv6 = 1
        net.ipv6.conf.default.disable_ipv6 = 1
        net.ipv6.conf.lo.disable_ipv6 = 1

        Then run sysctl -p

        Reply
  28. Hello Ravi,
    I stuck on this command “make install-daemon-config”. It is showing the error “make: *** No rule to make target `install-daemon-config’. Stop”.

    Reply
    • @Mani,

      That means your NRPE installation was not successful, try to install again and see if the nrpe plugin available from libexec directory…

      Reply
      • No such file and directory found, according to your document, it should show version of Nagios. Second question, i want to monitor “ps -ef | grep -i gmvuser” from remote machine, how to add entry for that in /usr/local/nagios/etc/nrpe.cfg file at remote server .

        Reply
  29. 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

    Reply
  30. 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.

    Thanks!

    Reply
    • @Aleks,

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

      Reply
  31. 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.

    Reply
    • @Jose,

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

      Reply
  32. [root@localhost 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
    thanks

    Reply
  33. 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

    Reply
  34. 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.
    Thanks!

    Reply
    • @Anu,

      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
      
      Reply
  35. HI,

    I am facing below error, while installing npre deamon.

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

    Reply
      • 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.

        Ankit

        Reply
        • 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

          Reply
          • 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.
            
          • @Randeep,

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

  36. 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.

    Reply
    • 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

      Reply
  37. hiii
    i m facing this error how can remove it and how can share my screen shot

    CHECK_NRPE: Socket timeout after 10 seconds.

    Reply
    • @Abhishek,

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

      Reply
  38. HI Ravi

    Ravi it seems the configuration is not complete, you did used default templates for commands but some how they are not working, I’m getting error monitoring ssh:
    OK – load average: 0.01, 0.02, 0.05
    USERS OK – 0 users currently logged in
    NRPE: Command ‘check_ssh’ not defined

    SSH is something installed on the server by default

    Regards

    Reply
    • @Zack,

      You need to define check_ssh command in services.cfg file in Nagios monitoring server as well as in nrpe.cfg file on host machine..

      Reply
      • @Ravi , when i create another file under /usr/local/nagios/etc , after putting entry in nagios.cfg then error comes like Nagios Configuration error: “Unexpected token or statement in file” during Pre-flight check
        configuration nagios

        Comes ! Why ?

        Reply
  39. Im getting error while executing below commands.

    [root@Test2 nrpe-3.0]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config’. Stop.

    [root@Test2 nrpe-3.0]# make install-xinetd
    make: *** No rule to make target `install-xinetd’. Stop.

    And im not able to see nrpe file at /etc/xinetd.d/

    I have made /etc/service entry for NRPE,
    But not able to see port 5666 open.
    Please reply.

    Reply
  40. this article is not working or not proper steps.. i have try 3 times this article but when try to install nrpe 3.0 configuration it shows [root@vps nrpe-3.0]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config’. Stop. this error and more…..please tell me what is the issue

    Reply
    • after ./configure during nrpe installation , use below steps , forgot article steps

      make all
      make nrpe
      make check_nrpe
      make install-groups-users
      make install
      make install-plugin
      make install-daemon
      make install-config
      make install-inetd
      make install-init

      Reply
  41. im try to install make install-daemon-config but it can’t executed ?????????????

    im getting this error while install make install-daemon-config command [root@vps nrpe-3.0]# make install-daemon-config
    make: *** No rule to make target `install-daemon-config’. Stop.

    Reply
  42. any one help me for nagios Compile and install the NRPE addon ./configure command run time error.

    checking for type of socket size… size_t
    checking for Kerberos include files… configure: WARNING: could not find include files
    checking for pkg-config… pkg-config
    checking for SSL headers… configure: error: Cannot find ssl headers
    [root@localhost nrpe-3.0]#

    Reply
  43. Hi Ravi,

    I followed your procedures for both Nagios server set up and a remote machine setup. I am getting following error for verify NRPE daemon remotely.

    [root@nagios-server]# /usr/local/nagios/libexec/check_nrpe -H nagios-client
    CHECK_NRPE: Receive header underflow – only 0 bytes received (4 expected).
    [root@nagios-server etc]#

    log message from Nagios-server as follows
    Aug 26 14:44:23 nagios-server check_nrpe: Remote nagios-client does not support Version 3 Packets
    Aug 26 14:44:23 nagios-server check_nrpe: Remote nagios-client accepted a Version 2 Packet

    log message from Nagios-client as follows
    Aug 26 14:46:00 nagios-client xinetd[62465]: START: nrpe pid=24359 from=::ffff:10.251.226.114
    Aug 26 14:46:00 nagios-client nrpe[24359]: Error: Could not complete SSL handshake with : 1
    Aug 26 14:46:00 nagios-client xinetd[62465]: EXIT: nrpe status=0 pid=24359 duration=0(sec)

    I googled to get know more about the error, but couldn’t get the correct answer. You have any idea about the error?

    Thanks

    Reply
    • @Kishor,

      Make sure you have the same NRPE version installed on the both Nagios server and remote Linux client, and also make sure to add Nagios Server IP address in remote Linux nrpe.cfg file under Xinetd file..

      Reply
      • Hi Ravi,

        They both(Nagios server and remote client) at same version.

        [root@kinagios-server]# /usr/local/nagios/libexec/check_nrpe -V

        NRPE Plugin for Nagios
        Copyright (c) 1999-2008 Ethan Galstad ([email protected])
        Version: nrpe-3.0
        Last Modified: 07-12-2016
        License: GPL v2 with exemptions (-l for more info)
        =======================================================
        [root@nagios-client ~]# /usr/local/nagios/libexec/check_nrpe -V

        NRPE Plugin for Nagios
        Copyright (c) 1999-2008 Ethan Galstad ([email protected])
        Version: nrpe-3.0
        Last Modified: 07-12-2016
        License: GPL v2 with exemptions (-l for more info)
        SSL/TLS Available: OpenSSL 0.9.6 or higher required

        Also Nagios Server IP address existing in remote Linux nrpe.cfg file and in Xinetd file.

        I am wondering why its accepting only v2 packets even if they are at 3.0 version of NRPE

        Thanks!
        Kishore

        Reply
        • @Kishore,

          Thanks for sharing the details about NRPE version on both servers, seems strange problem, let me check and get back to you…

          Reply
          • Hello Ravi,

            I have the same issue: both server and client are both version: nrpe-3.0.

            Do you have any update on this?

          • @Kay,

            I think the issue with the latest Nrpe 3.0 version, might have been some bugs, try to use little older version of nrpe and see..

          • The error message misleading us.

            nagios-server check_nrpe: Remote nagios-client does not support Version 3 Packets
            nagios-server check_nrpe: Remote nagios-client accepted a Version 2 Packet

            It says remote client not accepting v3 packets.

            I configured multiple remote-clients, same error for all the clients. Then I re-configured the Nagios server itself which worked fine this time.

            Looks some thing gone wrong with Server setup initially.

          • @Kishore,

            Both Nagios Server and Client machines have same version of NRPE plugin installed to communicate properly, I suggest you to configure same NRPE version on all clients..

  44. Hi Tecmint Team / Ravi,

    Do we have any tutorial for SNMP trap monitoring using Nagios ? if not, can we get this documented ?

    Reply
    • @Jonus,

      No we don’t have a artice for SNMP trip monitoring, but we will create a article on same, could you tell us more about SNMP trap monitoring? is there any tool to do so or it has Nagios plugin available to setup?

      Reply
      • Definition of “variable bindings” SNMP Trap :

        An SNMP trap allows a network device or SNMP enabled devices to contact the network management(monitoring application) when there is a significant event.
        This is done via unsolicited SNMP messages.

        example of SNMP Trap:

        if a UPS is out of power, an SNMP trap will be sent to the network administrator’s computer with the message, “Out of power.” A door sensor can send messages when the door is open.

        The SNMP Trap allows the manager to be notified when there is a problem so he can respond to it quickly without having to manually check everything to see what the error is.
        The program can receive such SNMP messages (SNMP traps) and alert a network administrator about them using a variety of methods

        https://exchange.nagios.org/directory/Tutorials/Other-Tutorials-And-HOWTOs/Receiving-SNMP-Traps-in-Nagios/details

        Reply
    • Hi Ravi,

      As per the Nagios official portal(web site) the best Article to implement SNMP Trap using Nagios monitoring given in below link:

      The SNMP Trap Implementation given in below source or URL may be good and accurate, but as I am unable to understand it because this is not much descriptive as like as the tecmint articles are.

      I am too much confident and sure if tecmint publish article on SNMP Trap monitoring that could be understand by everyone or most of the people.

      https://exchange.nagios.org/directory/Tutorials/Other-Tutorials-And-HOWTOs/Receiving-SNMP-Traps-in-Nagios/details

      Reply
      • @Jonus,

        Thanks for the information about SNMP, we take a look and write a detailed easy to understand article on same, just give us some time..

        Reply
  45. I get to the part where I need to make install-xinetd and run into an issue…

    [root@ip-172-24-2-0 nrpe-3.0]# make install-xinetd
    make: *** No rule to make target `install-xinetd’. Stop.

    So I try to make install-inetd and I get it…

    [root@ip-172-24-2-0 nrpe-3.0]# make install-inetd
    No inetd file to install
    make: *** [install-inetd] Error 1

    This is on Centos 6.8. Any ideas?

    Reply
    • @Nick,

      Have you installed Xinetd package before running that command? If no, install it or else it seems your NRPE installation was not successful..

      Reply
  46. 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.

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

    Reply
      • 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

        Reply
        • @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.

          Reply
        • @Mukesh,

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

          Reply
  48. 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

    Reply
    • @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.

      Reply
  49. 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)?

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

    Reply
    • @Ashok,

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

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

    Reply
    • @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..

      Reply
      • 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

        Reply
      • 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

        Reply
  52. @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$
    }

    Reply
    • @Balaraju,

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

      Reply
  53. 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

    Reply
    • @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…

      Reply
      • 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 :-)

        Reply
    • 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

      Reply
      • @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..

        Reply
  54. hi i have received the error “NRPE: Command ‘check_ping’ not defined” while defining it.

    root@alpha:/usr/local/nagios/etc# /usr/local/nagios/libexec/check_nrpe -H 192.168.9.250 -c check_swap
    NRPE: Command ‘check_swap’ not defined

    Reply
  55. Hey i appreciate this great article.
    However i have a road block and was wondering if anyone could please help.
    it gives me an error when i check fro errors

    Error: Cannot open config file ‘/usr/local/nagios/etc/hosts.cfg ;new file added ‘ for reading: No such file or directory
    Error processing object config files!

    ***> One or more problems was encountered while processing the config files…

    Check your configuration file(s) to ensure that they contain valid
    directives and data defintions. If you are upgrading from a previous
    version of Nagios, you should be aware that some variables/definitions
    may have been removed or modified in this version. Make sure to read
    the HTML documentation regarding the config files, as well as the
    ‘Whats New’ section to find out what has changed.
    my conf file is perfect as far as i know but i cant seem to figure out where the error is coming from

    #
    ###############################################################################

    # Define a host for the remote machine

    define host{
    use linux-server ; Name of host template to use
    ; This host definition will inherit all variables that are defined
    ; in (or inherited by) the linux-server host template definition.
    host_name nci-helicarrier.nci.nih.gov
    alias CentOS 6.5
    address 128.231.12.230
    }

    # Linux host definition template #

    define host{
    name linux-server ; The name of this host template
    use generic-host ; This template inherits other values from the generic-host template
    check_period 24×7 ; By default, Linux hosts are checked round the clock
    check_interval 5 ; Actively check the host every 5 minutes
    retry_interval 1 ; Schedule host check retries at 1 minute intervals
    max_check_attempts 10 ; Check each Linux host 10 times (max)
    check_command check-host-alive ; Default command to check Linux hosts
    notification_period workhours ; Linux admins hate to be woken up, so we only notify during the day
    ; Note that the notification_period variable is being overridden from
    ; the value that is inherited from the generic-host template!
    notification_interval 120 ; Resend notifications every 2 hours
    notification_options d,u,r ; Only send notifications for specific host states
    contact_groups admins ; Notifications get sent to the admins by default
    register 1 ; DONT REGISTER THIS DEFINITION – ITS NOT A REAL HOST, JUST A TEMPLATE!
    }
    [Ryan01@ nci-s078880 ~]$

    even the objects configuration file seems perfect

    # OBJECT CONFIGURATION FILE(S)
    # These are the object configuration files in which you define hosts,
    # host groups, contacts, contact groups, services, etc.
    # You can split your object definitions across several config files
    # if you wish (as shown below), or keep them all in a single config file.

    # You can specify individual object config files as shown below:
    cfg_file=/usr/local/nagios/etc/objects/commands.cfg
    cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
    cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
    cfg_file=/usr/local/nagios/etc/objects/templates.cfg
    cfg_file=/usr/local/nagios/etc/hosts.cfg ;new file added
    cfg_file=/usr/local/nagios/etc/services.cfg ;new file added

    # Definitions for monitoring the local (Linux) host

    i cant seem to find the issue here

    1) the file is readable
    2) its labelled right
    3) The only thing i changed on it was the (hostname, alias and IP addresse.) Please help if you can.

    Reply
  56. I also got error “check_nrpe: No such file or directory.”, I copied complete libexec (/usr/local/nagios/libexec) directory from client host.
    Issue has resolved.

    Reply
  57. Hi Ravi,

    I realy appricaite your effort for preparing & sharing wonderful articles.

    While running ./configure cmd in Nagios monitoring server, i am getting below prompt.

    checking for strstr… yes
    checking for strtoul… yes
    checking for initgroups… yes
    checking for closesocket… no
    checking for socklen_t… yes
    checking for type of socket size… size_t
    checking for SSL headers… configure: error: Cannot find ssl headers
    [root@localhost nrpe-2.15]#

    Even not finding nrpe file inside xinetd folder

    [root@localhost nrpe-2.15]# cd /etc/xinetd.d/
    [root@localhost xinetd.d]# ls -lrt
    total 4
    -rw-r–r–. 1 root root 332 Mar 28 2014 rsync
    [root@localhost xinetd.d]#

    From Client configuration end, everything seems to ve fine.

    Help me out to fix this.

    Thank you

    Reply
    • @Vinay,

      It’s because you don’t have SSL libraries installed on your system to configure Nagios nrpe properly, just install those missing SSL headers using following command and try the configure script again:

      # yum install openssl openssl-devel
      
      Reply
  58. Hi Ravi,

    I want to check the disk space usage of a mounted server. That is the path where to check the disk space is to be customized.
    I have installed nrpe plugin 2.14.
    After the installation, i have defined the remote service in localhost.cfg like this..
    define service{
    use generic-service ; Name of service template to use
    host_name step-sa-sjc0
    service_description Check Free space in /auto/ses/ location
    check_command check_nrpe!check_auto_ses
    }

    Changed the command.cfg as this:
    # ‘check_nrpe’ command definition
    define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
    }

    Finally the nrpr.cfg like this:
    dont_blame_nrpe = 1
    Added this line:
    command[check_auto_ses]=/opt/nagios/libexec/check_disk -w 20% -c 10% -p /auto/ses

    But its giving the error: “Connection refused by host.”

    I am not able to figure out the problem. Appreciate your help.

    Thanks

    Reply
  59. Hi Ravi,

    I am configuring nagios nrpe plugin and getting below error. please assist.

    [root@nagiosClient Desktop]# netstat -at | grep 5666
    [root@nagiosClient Desktop]# /usr/local/nagios/libexec/check_nrpe -H 10.0.0.20
    connect to address 10.0.0.20 port 5666: Connection refused
    connect to host 10.0.0.20 port 5666: Connection refused
    [root@nagiosClientDesktop]/usr/local/nagios/libexec/usr/local/nagios/libexec/check_nrpe -H localhost
    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
    [root@nagiosClient Desktop]#

    Reply
        • @Deepak,
          Yes not an issue, if you turnoff firewall for testing. After disabling firewall? will you able to see that the port 5666 is listening?

          Reply
        • I turned on firewall and allowed port 5666.

          [root@nagiosClient Desktop]# service iptables status
          Table: filter
          Chain INPUT (policy ACCEPT)
          num target prot opt source destination
          1 ACCEPT all — 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
          2 ACCEPT icmp — 0.0.0.0/0 0.0.0.0/0
          3 ACCEPT all — 0.0.0.0/0 0.0.0.0/0
          4 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
          5 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:5666
          6 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
          7 ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666

          Chain FORWARD (policy ACCEPT)
          num target prot opt source destination
          1 REJECT all — 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

          Chain OUTPUT (policy ACCEPT)
          num target prot opt source destination

          Reply
          • How can i checked whether port 5666 is listening or not ?

            when I tried to run below command. nothing is coming out

            [root@nagiosClient Desktop]# netstat -at | grep 5666
            [root@nagiosClient Desktop]#

          • Its not listening port 5666.

            [root@nagiosClient Desktop]# telnet 10.0.0.21 5666
            Trying 10.0.0.21…
            telnet: connect to address 10.0.0.21: Connection refused
            [root@nagiosClient Desktop]#

          • Hi Ravi

            I configured everything on client host now. but now i am not able to get check_nrpe script on nagios server side.
            As per your steps we have to run below command to very nrpe daemon on server side

            [root@tecmint]# /usr/local/nagios/libexec/check_nrpe -H

            however check_nrpe does not exist in libexec directory.

            [root@NagiosServer nrpe-2.15]# /usr/local/nagios/libexec/check_
            check_apt check_jabber check_ping
            check_breeze check_ldap check_pop
            check_by_ssh check_ldaps check_procs
            check_clamd check_load check_real
            check_cluster check_log check_rpc
            check_dhcp check_mailq check_sensors
            check_dig check_mrtg check_simap
            check_disk check_mrtgtraf check_smtp
            check_disk_smb check_mysql check_spop
            check_dns check_mysql_query check_ssh
            check_dummy check_nagios check_ssmtp
            check_file_age check_nntp check_swap
            check_flexlm check_nntps check_tcp
            check_ftp check_nt check_time
            check_http check_ntp check_udp
            check_icmp check_ntp_peer check_ups
            check_ide_smart check_ntp_time check_uptime
            check_ifoperstatus check_nwstat check_users
            check_ifstatus check_oracle check_wave
            check_imap check_overcr
            check_ircd check_pgsql

          • Hi Ravi,

            Finally setted up everything as per your tutorial. But there are two points i want to raise.

            1. please make two changes in you tutorial.

            In Step 1. add below command
            [root@tecmint]# make install-Plugin

            On Server side:
            The correct path for hosts.cfg and services.cfg is /usr/local/nagios/etc/objects

            I think this difference is due to different versions of NRPE Plugin.

            2. I am still not able to see my client host on Web Interface of Nagios Server. it is showing maching in two ways i;e as localhost and as hostname of the machine. however client machine is still missing. please assit.

          • @Deepak,

            Thanks for the findings and suggestions, let me give a try again and see if there is change in installation and configuration paths, we will make change as per new version of nrpe..thanks again..

          • I am still not able to see my client host on Web Interface of Nagios Server. it is showing my nagios server machine in two ways i;e as localhost and as a hostname of the machine. however client machine is still missing. please assist.

          • Your welcome. But my client machine is still not reflecting on Server side. Web Interface of Nagios is only showing Nagios server machine. I can’t attached the screenshot of nagios web interface. could you please share troubleshoot steps

          • Thank for your help.. I have shared the details with you. but not sure whether you can ping me or not as I have setup this machine on VM.

      • hi Ravi,
        I could not able to download nrpe plugin for nagios monitor server by below url’
        wget http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

        showing below error.
        [root@ip-172-31-16-82 nagios]# wget http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
        –2016-01-20 07:15:23– http://garr.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
        Resolving garr.dl.sourceforge.net (garr.dl.sourceforge.net)… failed: Name or service not known.
        wget: unable to resolve host address ‘garr.dl.sourceforge.net’
        [root@ip-172-31-16-82 nagios]#

        Kindly share correct url

        Reply
        • @Santanu,

          Thanks a ton for informing us, seems the link is dead now, added new working download link of nrpe plugin and sorry for trouble..

          Reply
  60. Hi Ravi,
    Thanks a lot for nice presentation.
    I got stuck in two nagios servers for two sites:
    1. One site form client side says “CHECK_NRPE: Error – Could not complete SSL handshake.”. I tired all those techniques by adding allowed hosts in nrpe.cfg file/adding nagios ip in nrpe file….but failed. Can you please recommend what I should do.
    2. Another site, when I am going to browse the nagios web-interface it says “Error 404-File not found”

    I need your advice.

    Thanks
    bikram

    Reply
    • @Bikram,
      In first scenario, make sure that port 5666 port opened in remote Linux system on Firewall and also make sure that you’ve added Nagios Monitoring Server IP address in nrpe file under Xinetd..

      Second problem, could be SELinux, try to disable it and then try again or if you still get same problem that means your Nagios installation was unsuccessful.

      Reply
  61. There’s an error under NAGIOS MONITORING SERVER:
    Compile and install the NRPE addon.

    [root@tecmint]# ./configure
    [root@tecmint]# make all
    [root@tecmint]# make install-daemon

    it should be “make install-plugin”
    That’s why I got error “check_nrpe: No such file or directory.”

    Reply
  62. Hi,

    Any idea why check_nrpe is missing on the Hosts Server, I’ve installed as from your steps but cannot find the file check_nrpe from /usr/local/nagios/libexec/.

    Reply
    • @Ferdz,
      If check_nrpe is missing on the host, that means your installation was not successful. Please try to follow steps again carefully..

      Reply
      • Thanks for the reply Ravi, have managed to resolve the check_nrpe missing but now facing this error.

        CHECK_NRPE: Error – Could not complete SSL handshake.

        Still trying to figure out where the issue is. Any idea on this error?

        Reply
        • @Ferdz,
          Just add Nagios Monitoring Server IP address under xinetd directory in nrpe file like this:

          only_from = 127.0.0.1 localhost 
          

          Else follow Step 7 correctly in this article..

          Reply
  63. I was able to follow this to monitor the remote windows server (Windows server 2008 R2), however I have a tomcat server running on that system that i actually need to monitor. Any ideas how I could proceed with that?

    Reply
  64. Hi Ravi,

    I just want your help on how to execute windows commands remotely from Linux server?

    For Linux to Linux it is possible using below command.
    #ssh [email protected] ls -l

    But for Linux to Windows it is not possible , do you have any document / solution for this ?
    #ssh [email protected]

    Thanks,
    Jonus Joseph

    Reply
  65. Nice Article, I used this article for configuring the Remote linux host on Nagios Server and it got configured properly without any error.

    Reply
  66. when i am excute make install-xinetd it tell /usr/bin/install -c -m 644 sample-config/nrpe.xinetd /etc/xinetd.d/nrpe this is correctly installed or not

    Reply
  67. Hi when I execute /usr/local/nagios/libexec/check_n then press tab not coming nrpe in nagios server
    it will come for check_nagios check_ntp..like that but nrpe is not shown here

    Reply
  68. The 2 problems I encountered and resolved were the following:

    1. In the Nagios 4.0.1 Installation Guide on RHEL/CentOS 6.x/5.x & Fedora 19/18/17 article ## include openssl and openssl-devel needing to be installed on the Nagios Server
    2. Not sure why during the NRPE install on the Nagios Server, the check_nrpe program did not get copied in the /usr/local/nagios/libexec/ directory so I copied it over.

    Everything else worked as expected and I am monitoring remote servers.

    Reply
  69. very useful information. I am wondering how to write a plugin from scratch and get the info displayed in nagios. I would like to create the plugin in my nagios server and not need to install any agents like nrpe but still be able to get some stats from remote server…is it possible ? if so, please point me to the right docs or send an email to [email protected] with any links.

    Reply
  70. Hi when I execute /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users it says
    NRPE: Unable to read output

    what went wrong?
    I follow the above procedure please help thanks!

    Reply
  71. I had installed the nagios server and configured nrpe by following the steps given.All the steps executed successfully but i am not able to see the remote host in nagios URL.Please help me out.Thanks in advance

    Reply
      • Ravi – Thanks for the tutorial. I have same questions. Lets say I have to monitor 10 nodes of same configuration, do I only need to add like below and thats it? OR do I need to add service monitoring for each server separately? I tried to use below configuration but my all servers are showing similar data. Looks like some configuration is messed up. Please help with the process of adding multiple servers in same hostgroup.

        define host{
        use linux-server
        host_name brpc001
        alias brpc001 – Test server for nagios
        address 10.20.30.21
        contact_groups admins
        }

        define host{
        use linux-server
        host_name brpc002
        alias brpc002 – Test server for nagios
        address 10.20.30.22
        contact_groups admins
        }

        define host{
        use linux-server
        host_name brpc003
        alias brpc003 – Test server for nagios
        address 10.20.30.23
        contact_groups admins
        }

        define host{
        use linux-server
        host_name brpc005
        alias brpc005 – Test server for nagios
        address 10.20.30.25
        contact_groups admins
        }

        Reply
  72. (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    Reply
  73. Hello ,

    Am getting the below error while trying to open hosts and service tab in Nagios webpage .

    Error:
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Reply
    • @Madhan,
      It seems your Nagios installation was not correct, try to follow steps carefully and install all required packages before compiling the Nagios.

      Reply
      • Am getting the error “SSH Monitoring;CRITICAL;SOFT;1;(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory” in Nagios Page , Seems the server is not getting monitor .

        Reply
      • Host Sort by host name (ascending)Sort by host name (descending) Service Sort by service name (ascending)Sort by service name (descending) Status Sort by service status (ascending)Sort by service status (descending) Last Check Sort by last check time (ascending)Sort by last check time (descending) Duration Sort by state duration (ascending)Sort by state duration time (descending) Attempt Sort by current attempt (ascending)Sort by current attempt (descending) Status Information

        CPU Load
        CRITICAL 06-23-2015 15:44:26 0d 1h 36m 38s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory
        Current Users
        CRITICAL 06-23-2015 15:45:30 0d 1h 35m 34s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory
        FTP Monitoring
        CRITICAL 06-23-2015 15:46:34 0d 1h 34m 30s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory
        SSH Monitoring
        CRITICAL 06-23-2015 15:37:38 0d 1h 33m 26s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory
        Total Processes
        CRITICAL 06-23-2015 15:38:42 0d 1h 32m 22s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

        Reply
    • when u installing nrpe packg in both side ,jest follow this steps (in above sever side not completely installed )
      ./configure
      # make all
      # make install-plugin
      # make install-daemon
      # make install-daemon-config
      # make install-xinetd

      Reply
  74. succesfully completed client installation but in server while i am verifying. it gives a error Cannot able to open the file /usr/local/nagios/etc/server.

    Reply
  75. I just need to know the procedure for installing Nagios on clients centos servers, not the Nagios server, what pkgs i need to install on client machine, i’m running centos7
    Thx

    Reply
  76. Sir , i am getting an error in the ‘Adding remote linux host to nagios montoring server where i have created files namely Hosts and Services and added them in nagios .cfg as well.. But when i use gedit to open Hosts.cfg it shows empty file.. So where am i going wrong? Im sure i have done all above steps correctlu.. Please help thanks

    Reply
  77. CPU load UNKNOWN 03-21-2015 09:48:08 0d 0h 17m 8s 3/3 NRPE: Unable to read output
    Current Users UNKNOWN 03-21-2015 09:49:11 0d 0h 16m 5s 3/3 NRPE: Unable to read output
    FTP Monitoring CRITICAL 03-21-2015 09:50:15 0d 0h 48m 59s 3/3 NRPE: Command ‘check_ftp’ not defined
    SSH Monitoring CRITICAL 03-21-2015 09:48:00 0d 0h 47m 55s 3/3 NRPE: Command ‘check_ssh’ not defined
    Total Processes UNKNOWN 03-21-2015 09:49:04 0d 0h 16m 12s 3/3 NRPE: Unable to read output

    Reply
  78. Current Load CRITICAL 03-20-2015 20:38:24 0d 3h 59m 13s 4/4 (No output on stdout) stderr:
    Current Users OK 03-20-2015 20:41:02 0d 7h 56m 34s 1/4 (No output on stdout) stderr:
    HTTP WARNING 03-20-2015 20:40:37 0d 7h 55m 57s 4/4 HTTP WARNING: HTTP/1.1 403 Forbidden – 5155 bytes in 0.000 second response time
    PING OK 03-20-2015 20:42:17 0d 7h 55m 19s 1/4 (No output on stdout) stderr:
    Root Partition OK 03-20-2015 20:37:54 0d 7h 54m 42s 1/4 (No output on stdout) stderr:
    SSH Notifications for this service have been disabled CRITICAL 03-20-2015 20:41:27 0d 7h 54m 4s 4/4 (No output on stdout) stderr:
    Swap Usage OK 03-20-2015 20:39:09 0d 7h 53m 27s 1/4 SWAP OK – 100% free (4895 MB out of 4895 MB)
    Total Processes OK 03-20-2015 20:39:47 0d 7h 52m 49s 1/4 PROCS OK: 87 processes with STATE = RSZDT

    Reply
  79. Ravi,
    Thank your for your superb docs . I have configured Nagios and working well…..But I have a problem in the configuration of the statusmap.
    Pls help me to get the status map….

    Thanks in advance
    -Noufal

    Reply
  80. Thanks for the information ..
    While installing NRPE Plugin on Monitoring server i am getting
    “checking for SSL headers… configure: error: Cannot find ssl headers” while running ./configure

    Run “yum install -y openssl-devel” to resolve the error .

    Reply
    • @Papouz,
      Which next article you talking about, we’ve already included links to the installation of Nagios and how to add windows host to Nagios at the beginning of the article. Please check and let me know is there anything you want from us..

      Reply
  81. [root@node2 nrpe-2.15]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
    CHECK_NRPE: Error – Could not complete SSL handshake.

    anybody??? =(

    Reply
  82. Hi all,

    While i tried to install and compile the NRPE plugins with the ./configure-command, i received following error:

    checking for SSL headers… configure: error: Cannot find ssl headers

    To fix this on CentOS you need to install the openssl-devel package.
    # yum install openssl-devel

    Cheers,
    Tom

    Reply
    • @Shantanu,
      Here is the command to check memory usage of remote linux client from Nagios server..make sure you opened port 5666 on remote linux client.

      # /usr/local/nagios/libexec/check_nrpe -H localhost -c check_mem -f -w 20 -c 10 
      
      Reply
  83. I can confirm if I follow the same procedure for the remote and local host, i.e. installing the plugin, daemon and daemon config, then I get the check_nrpe file present in the required directory.

    Ruth

    Reply
  84. Hi Ravi,

    Thanks for this detailed and helpful article. I followed the instructions to the letter, and I see the remote host on the Nagios dashboard, however I get the error on all checks that others have reported:

    (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    I think this problem is due to the fact that when you install the daemon on the Nagios server, the check_nrpe file is not installed, as others suggested, so the checks do not work.

    On the remote host when installing, you advise to run the following:

    [root@tecmint]# make install-plugin
    [root@tecmint]# make install-daemon
    [root@tecmint]# make install-daemon-config

    But on the Nagios server only to run

    [root@tecmint]# make install-daemon

    Could this possibly be related? I don’t know – but I also have the same issue in that the check_nrpe file is missing on the Nagios server, and is present on the Remote server.

    Ruth

    Reply
    • @Ruth,
      It could be incomplete installation…it seems your installation is not perfect that’s the reason some plugins missing…try to follow instructions again..

      Reply
    • That’s correct Ruth, I had this error after running the following command on the monitoring nagios server:
      (Step 2: Verify NRPE Daemon Remotely)
      /usr/local/nagios/libexec/check_nrpe -H
      -bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory

      And as you pointed out was due to not having executed:
      [root@tecmint]# make install-plugin
      [root@tecmint]# make install-daemon
      [root@tecmint]# make install-daemon-config

      Therefore the instructions on “Monitoring Server – Step 1: Install NRPE Plugin:”
      should be:
      [root@tecmint]# tar xzf nrpe-2.15.tar.gz
      [root@tecmint]# cd nrpe-2.15
      Compile and install the NRPE addon.

      [root@tecmint]# ./configure
      [root@tecmint]# make all
      [root@tecmint]# make install-daemon

      [root@tecmint]# make install-plugin
      [root@tecmint]# make install-daemon
      [root@tecmint]# make install-daemon-config

      Thank you for your help Ruth

      Reply
  85. if i try to run nagios command to check the remote linux host then it shows me the result but only doesnt work if i add host nagios config !!

    will you please give little bit explantion how can i trouble shoot this problem?

    thankss

    Reply
    • @Kunal
      It seems that host key of the remote host was changed, you need to manually edit or remove that key from the ~/.ssh/known_hosts file and then try.

      Reply
  86. Hii Ravi!! I have followed your article and i have got strange problem

    Remote command execution failed: Host key verification failed.

    I get this unknown error on Nagios Web page.

    you help will be really appreciating!!!

    Thanks

    kunal

    Reply
    • @Kunal,
      Seems problem with SSH, i think plugin not able to authenticate with your remote SSH server, please check SSH keys both end..

      Reply
  87. I’m getting the following error from the server side.

    # /usr/local/nagios/libexec/check_nrpe -H 10.18.1.14
    connect to address 10.18.1.14 port 5666: Connection refused
    connect to host 10.18.1.14 port 5666: Connection refused

    SELINUX – Disabled in server and client
    IPTABLES – no rules @ server
    ACCEPT tcp — 0.0.0.0/0 0.0.0.0/0 tcp dpt:5666 @ client side…

    Please suggest what if i need to do

    Reply
  88. Hi Ravi,
    Thank you very much. i have done it. my nagios server and remot host are centos mechine and it is working fine.
    Can you please help me in how to add a ubuntu client mechine to nagios server.
    Wish you happy new year 2015.

    Reply
    • @Vinay,
      That’s great to hear that finally your Nagios setup is working properly..currently instructions supports RedHat based systems, we will soon add steps to add Ubuntu to Nagios server..stay tuned for updates….and wish you same..happy new year..

      Reply
  89. Hi ravi,
    i have created hosts.cfg and services.cfg, and given the entry in the nagios file but this file is blank.can you please help me to get the default template.

    Reply
    • @Vinay
      Please follow the instructions given in the article, I’ve already explained how to add host and services to these two files..please read carefully..

      Reply
  90. Ravi your articles are great. I was a real newbie to Linux and started off installing Nagios from your articles. I have used all 3 articles regarding installing Nagios on Server, Installing Remote Linux & Windows Hosts.

    Everything works fine except for the fact I get an error on my web interface saying

    “(Return code of 255 is out of bounds)”

    for all services I configured for Nagios Server,

    Reply
      • I get this error for Services Configured for my Nagios Server. Not to my remote hosts.

        ex:

        Host Services Status Information
        ===== ========= =================
        Nagios_Server CPU Load (Return code of 255 is out of bounds)
        Current Users (Return code of 255 is out of bounds)
        HTTP (Return code of 255 is out of bounds)
        SSH Monitoring (Return code of 255 is out of bounds)
        Swap Usage (Return code of 255 is out of bounds)
        Total Processes (Return code of 255 is out of bounds)
        Zombie Procs (Return code of 255 is out of bounds)

        Reply
        • @Kaveen,
          Have you added Nagio Server IP address to remote host nrpe.cfg file? or the plugin has correct write permissions? Please check all these

          Reply
  91. Ravi,

    I tried and fixed the issue. Thank you for your fabulous link. I would also request you to pen down the steps to add different services like mysql, jboss, tomcat etc.

    Thanks & Regards

    Reply
    • @Ritesh,
      I’ve never tried yet those services, have you tried? If yes, could you please provide us steps so that I can include in this article..

      Reply
  92. Hello Ravi,

    To monitor any Linux hosts we install nrpe,
    My concern is how does nrpe execute its command from nagios to remote host ?

    Eg:

    Remote Server: NRPE file (nrep.cfg):

    command[check_cpu_jonus]=/usr/local/nagios/libexec/check_cpu -w 80 -c 90

    Nagios Side:

    #/usr/local/nagios/libexec/check_nrpe -H 192.168.6.1 -p 5666 -c check_cpu_jonus

    My question is how does nagios execute this check (check_cpu_jonus) on remote server through SSH ? or any other protocol ?

    or in other words i can say if we remove SSH from remote host will this check (check_cpu_jonus) will execute on remote host and give output to nagios server ?

    Please help me to understand how does NRPE works from nagios server to remote server which we want to monitoring.

    Thanks in advance.

    -Jonus Joseph

    Reply
    • @Jonus,
      NRPE works as a agent on remote machines to fetch resources such as system load, disk usage, whos’ online and other monitoring stuff via a script that is hosted on remote host.. it uses port 5666 to execute all commands on the remote host.

      Reply
  93. how to remove server entry in nagios monitoring system, please let me know. I have disabled the host entry lines in host entry file, bu showing in nagios monitoring

    Reply
  94. Ravi,

    I have verified my configs still couldn’t remove “CHECK_NRPE: Error – Could not complete SSL handshake” from nagios web page.

    Could you kindly help me please.

    Note: Nagios server ip is there on /etc/xinetd.d/nrpe

    Reply
    • Further for your information, I am working on CentOS Linux release 7.0.1406 (Core)

      And your nrpe download link isn’t working(Step 1: Install NRPE Plugin(on monitoring server).

      Your advise is eagerly awaited!

      Regards

      Reply
  95. Hello,

    My question is : How to add icon/image in front of host or services on nagios portal.
    for example i have one host in nagios it is RHEL7 i want to keep icon/image of REDHAT in front of host on nagios portal so that i can recognize easily.
    how to do this process through nagios configurations ?

    Thank you very much in advance.

    -Jonus Joseph

    Reply
  96. The article is great and working,

    How do I add more than one linux host? should I create separate host.cfg file or can it be given using comma separator?

    Reply
      • Thank you for that, I have a strange issue now, I am monitoring two linux machines and the second one says Service Check Timed Out for check_smtp status where as the first one is fine.

        when I do the same from command line

        [root@nagios]# /usr/lib64/nagios/plugins/check_smtp x.x.x.x
        SMTP OK – 0.056 sec. response time|time=0.055673s;;;0.000000

        its working fine, only pb is from web interface,

        I have even tried increasing the timeout using -t argument in the commands.cfg file

        Reply
  97. Great post!
    All the services work just fine except one – I am getting errors with the FTP service – check_ftp. I have defined the service and edited the services.cfg file as well as the nrpe.cfg.

    But, I receive the error as ‘Connection refused’. I am trying from command line on the remote host: ./check_ftp -H and this gives me ‘connect to address and port 21: Connection refused’. Same error on the Nagios UI.

    I have Firewalls turned off. What could be the issue here?

    Thanks

    Reply
  98. Hi Mate,

    Very NIce article.. I have installed Nagios in Aws cloud.. I can telnet from nagios server to remote server.. But GUI always shows host is down..

    usr/local/nagios/libexec/check_nrpe -H *.*.*.*
    gives
    NRPE v2.15..

    Can you please suggest what might be the problem.. Thanks once again..

    Reply
  99. Hi, this guide worked very well for me, however I am curious as to why the Cgi refers to the Nagios server as “localhost” rather than the actual server name. Is there a reason for this? I’ve tried several ways around this, but they all seem to break something….

    Reply
  100. Hello..

    The document is very useful
    I have configured the whole configuration. Everything went successfully.But when I checked nagios web interface all the services were in critical condition with the description (Return code of 20 is out of bounds) & Connection refused by host
    My nagios server is Centos and client is Fedora20

    When i check all these services manually from the terminal of the server i am getting the required information. I am stuck here. please help me to sort out of this

    Reply
  101. It show in ps as below.

    ps -aux | grep logstash
    Warning: bad syntax, perhaps a bogus ‘-‘? See /usr/share/doc/procps-3.2.8/FAQ
    logstash 27423 166 2.1 1706480 84716 pts/0 SNl 18:31 0:03 /usr/bin/java -Djava.io.tmpdir=/var/lib/logstash -Xmx500m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -jar /opt/logstash/vendor/jar/jruby-complete-1.7.11.jar -I/opt/logstash/lib /opt/logstash/lib/logstash/runner.rb agent -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log

    Reply
  102. Hi Ravi Saive!

    I am using logstash. How can i monitor it. it is not install as a typical server rathar than script mode. When i use check_tcp to monitor the port it is listening on or by using check_procs, it close with exception error. How can i verify it weather it is running or not.

    Reply
  103. Ravi,

    The post was very helpful, Thanks for that.

    1) Suppose if I wanted to add more servers then do i need to create hosts.cfg and services.cfg for every hosts ?
    2) Also, I want my localhost to be monitored for some specific services as well, where do i have to configure for that ?
    3) for some services its giving me error that “NRPE : command check_ftp not found” how I can resolve this ?

    Reply
    • Dear Gaurav,

      Thanks for the kind words, please see the answers for all your 3 points.

      1. No need to create each file, just add the hosts info in hosts.cfg file and services in services.cfg file.
      2. Yes, you can define specific services for localhost machine in localhost.cfg, this will be located somewhere in nagios folder, search for it.
      3. You need to define those services commands in services.cfg file at Nagios server and in nrpe.cfg file in remote host file.

      Reply
  104. I have a RHEL 6.3 server that is registered with red hat. I’ve installed the nagios plugins(2.0.3) and the nrpe-2.15.

    When I run the following command, netstat -at | grep nrpe I get nothing.

    When I run the following command, /usr/local/nagios/libexec/check_nrpe -H localhost I get:

    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

    When i do a less /var/log/messages I get the following:

    Sep 11 09:06:03 localhost xinetd[46274]: Server /usr/local/nagios/bin/nrpe is not executable [file=/etc/xinetd.d/nrpe] [line=11]
    Sep 11 09:06:03 localhost xinetd[46274]: Error parsing attribute server – DISABLING SERVICE [file=/etc/xinetd.d/nrpe] [line=11]
    Sep 11 09:06:03 localhost xinetd[46274]: Must specify a server in nrpe
    Sep 11 09:06:03 localhost xinetd[46274]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
    Sep 11 09:06:03 localhost xinetd[46274]: Started working: 0 available services
    Sep 11 09:07:48 localhost xinetd[46274]: Exiting…

    When I run a ps -ef |grep xinetd, I get:

    root 5107 1 0 09:26 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
    root 32359 13266 0 09:54 pts/0 00:00:00 grep xinetd

    I’ve restarted the xinetd process multiple times

    When I run grep nrpe /etc/services I get:

    nrpe 5666/tcp # NRPE

    I added port 5666 to the iptables:

    *filter
    :INPUT ACCEPT [368773:68873995]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [372083:68473830]
    -A INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
    -A INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
    COMMIT
    # Completed on Thu Sep 11 09:21:53 2014

    My /etc/xinetd.d/nrpe configuration file looks like this:

    # default: on
    # description: NRPE (Nagios Remote Plugin Executor)
    service nrpe
    {
    flags = REUSE
    socket_type = stream
    port = 5666
    wait = no
    user = nagios
    group = nagios
    server = /usr/local/nagios/bin/nrpe
    server_args = -c /usr/local/nagios/etc/nrpe.cfg –inetd
    log_on_failure += USERID
    disable = no
    only_from = 192.168.0.29
    }

    I’ve also tried adding in the 127.0.0.1 in the only_from field and I get the same problem.

    xinetd is running:

    chkconfig –list xinetd
    xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off

    when i run lsof -i:5666, i get nothing

    I noticed There is no path for /usr/local/nagios/bin/nrpe, the furthest i can go is /usr/local/nagios, there is no bin directory in the nagios folder. Maybe this is the problem?

    Reply
  105. I wish to monitor 3 servers which is running in LINUX machine from my windows nagwin .

    Do I need to configure the steps of this article for every 3 Linux machines?

    Reply
  106. i hv used check_udp as following.

    ./check_udp -H Server IP -p 514 -s 0x1234 -e ” -v
    ./check_udp -H Server IP -p 514 -s 0x1234 -e E
    ./check_udp -H Server IP -p 514 -s 0x1234 -e 1 etc.

    Reply
  107. Hi Geeks

    We have configured Nagios v4 on Centos 6.5 to monitor our logging server.
    Everything is fine with TCP but problem with UDP. we we use following command we receive response OK.
    nmap -p 514 -sU -P0 172.20.16.81 But when we check weather port is listening by using
    netstat -at | grep syslog or netstat -at | grep rsyslog or netstat -at | grep 514
    there is nothing.

    Response of the following command ./check_udp with respective arguments is always Critical. What reason can be.I also used a script check_udp_port.sh but it output is not readable to Nagios.

    Reply
  108. Hi Ravi,

    I forget to add my another query, here is that

    This example is for adding only host to the nagios server, please let me know how we can add many host?

    – Karthik

    Reply
  109. Hi Ravi,

    Awesome!.. Very useful.

    I need to monitor services like named, mysql. So what are the libexec should I include in “/usr/local/nagios/etc/services.cfg” file.

    Also please suggest me, is it possible to set nagios to send notification sms alert to custom mobile number.

    – Karthik

    Reply
  110. Dear sir.

    i am installing nagios 4.0.1 server in Redhat linux 6.0.

    and my client system is ubuntu 12.04.3

    how to add my remote ubunut host in nagios server

    thanks

    krishna.

    Reply
  111. Hi Ravi,

    Please let us know that using nagios core can we set the alerts for application servers. if yes please let me know how to do that?

    Prasad
    7207087963

    Reply
  112. Hi Ravi,

    I need to add One more service to monitor SWAP on all Linux server.
    Please help me on this with steps.

    Present we are monitoring with Remote SSH script. weneed this with NRPE.

    Regards,
    Yuva

    Reply
  113. hi Ravi

    Please help me, im getting a error

    (No output on stdout) stderr: execvp(/usr/local/nagios/libexecHOSTADDRESS, …) failed. errno is 2: No such file or directory

    thanks

    Reply
  114. Hi Ravi, below herror i got when checking NRPE installation :

    [root@CCODNAGIOTZP01 nrpe-2.15]# /usr/local/nagios/libexec/check_nrpe -H localhost
    CHECK_NRPE: Error – Could not complete SSL handshake.
    [root@CCODNAGIOTZP01 nrpe-2.15]#

    would you advice pls

    Reply
  115. /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk -a 15%

    I execute this command ,the result is

    DISK CRITICAL – free space: / 61426 MB (80% inode=97%); /sys/fs/cgroup 0 MB (100% inode=99%); /dev 3982 MB (99% inode=99%); /run 798 MB (99% inode=99%); /run/lock 5 MB (100% inode=99%); /run/shm 3992 MB (100% inode=99%); /run/user 100 MB (100% inode=99%);| /=14965MB;80494;80504;0;80504 /sys/fs/cgroup=0MB;-10;0;0;0 /dev=0MB;3972;3982;0;3982 /run=0MB;788;798;0;798 /run/lock=0MB;-5;5;0;5 /run/shm=0MB;3982;3992;0;3992 /run/user=0MB;90;100;0;100

    why always DISK CRITICAL

    Reply
  116. I have followed ur code and added hosts but they are not monitored.
    Showing error like:
    return code of 127 is out of bounds – plugin may be missing

    Stuck badly
    Please help me out

    Reply
  117. Hi Sir,

    can you please tell me the entry for services.cfg for both hosts i have an ip for my hosts is 192.168.1.58 192.168.1.49 & server ip is 192.168.1.72

    Reply
    • Dear Vishnu,

      I’ve already shown in my instructions how to add hosts to services.cfg file. First you need define these hosts in hosts.cfg file and then add services for each host in services.cfg file. Please follow the instructions correctly and carefully, you will know. If you still need any help contact me.

      Reply
  118. Hi Sir,

    We have about 100 host to monitor, each has uniform configuration. Is there any way to install the nrpe addon once and run in all host?

    Thanks

    Reply
    • Better solution is write a shell script that contains all nrpe installation commands and run the script on each host to install nrpe.

      Reply
  119. ok,thanks,but the remote host monitoring is not working.

    the monitoring server is showing values of the localhost only.

    how it will show values & services of all connected host

    Reply
    • Have you added correct entries in host.cfg and services.cfg file? Please see and add correct entries as described in the article.

      Reply
  120. Hi, I am getting the below error:

    [root@n11 libexec]# /usr/local/nagios/libexec/check_nrpe -H localhost
    connect to address 127.0.0.1 port 5666: Connection refused
    connect to host localhost port 5666: Connection refused
    [root@n11 libexec]#

    I am using plugin 1.5 and NRPE 2.15
    P.S: Selinux and IPtables are disabled. Please help !

    Reply
  121. really very good tutorial, also want to know how to monitor different services like this. (check_oracle, check_mysql, check_time, check_dhcp) in local machine or remote as well as.

    Reply
    • You need to define those checks to commands.cfg and services.cfg files in Nagios server and nrpe.cfg in remote host file.

      Reply
  122. Hi

    I have defined the command on both Nagios Server and remote host on nrpe.cfg.

    Still I am getting error

    [root@Nagios Server ]# /usr/local/nagios/libexec/check_nrpe -H -c check_tomcat
    NRPE: Command ‘check_tomcat’ not defined

    Reply
      • It is already there

        [root@Nagios Server objects]# grep check_tomcat commands.cfg
        # ‘check_tomcat’ command definition
        command_name check_tomcat
        command_line $USER1$/check_tomcat -H $HOSTADDRESS$ $ARG1$

        Please suggest if the command_line is correct.

        Reply
        • Check command is correct, but have you added to services.cfg file in Nagios server and at the remote nrpe.cfg file?

          Reply
  123. Hi Ravi Sir,

    its very use full thanks alot,

    i have configure it completely, please tell me how can i connect multiple host with the server………

    Reply
  124. Hi Ravi, thanks a lot for your article, it’s extremely useful.

    I’m having an issue, i downloaded NRPE v2.15 tarball and installed it on a CentOS server, everything was OK with the installation but when i check the NRPE version it shows this:

    root@xxxxxxxxxx libexec # ./check_nrpe -H localhost
    NRPE v2.12

    What could be happening there??, i’m using nrpe-2.15.tar.gz for the installation, I’ve installed nrpe several times with the same tarball and never had this problem…

    Reply
    • No idea, but if you’re installing newer NRPE version on older installation, might not work as expected. So, better remove the all old NRPE installation files and try to re-install newer version again, hope this will give the latest version.

      Reply
  125. i am getting this error when restart nagios server please help me, i am trying to connect host with my nagios server

    Read main config file okay…
    Error: Unexpected EOF in file ‘/usr/local/nagios/etc/objects/commands.cfg’ on line 247 – check for a missing closing bracket.
    Error processing object config files!

    Reply
    • Hi Vishnu,

      In line 27 you didnt close the curly ({ }) in commands.cfg.. Please make sure the braces opened and closed for every command.

      Thanks,
      Krishna Mohan.G

      Reply
  126. Hi Ravi, you have provided good article, it is very use full, Thank you for your global support.

    I have different issue on web page service visibility, after refresh the multiple times the page display the service some time not, e.g. I have total 6 services added on particular host, apart from 6 some times it display only 5 services some times all.

    in http nagios error log i am receiving below errors
    File does not exist: /usr/share/nagios/cgi
    File does not exist: /usr/share/nagios/media/noproblem.wav

    Is it errors related to above issue.?

    Reply
    • The errors not related to the said issue, but the actual problem is your network connection failure. I think Nagios not able to pull data from the remote host due to connectivity issue. Can you check your network connection by doing some ping and traceroute.

      Reply
  127. Dear Ravi

    Follow all the instruction but error occur when click on services.
    The error as below.

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    Apache/2.2.15 (CentOS) Server at 10.101.243.80 Port 80

    Reply
  128. Hey, I’m getting this error when I try to run a command (check_load) with arguments

    Warning threshold must be float or float triplet!

    I changed the don’t blame flag to one, defined the nrpe.cfg like this

    [command…]=/…../check_load -w $ARG1$ -c $ARG2$

    and defined the service like this

    define service{
    use generic-service
    host_name monitor
    service_description CPU Load
    check_command check_nrpe!check_load!5.0,4.0,3.0!10.0,6.0,4.0
    }

    Some services are running, so it means is a problem with exactly this service. Can you help me with it?

    Reply
  129. The iptables command you gave didn’t work, did it in a CentOS machine and still blocks nrpe, instead i used this command and everything good to go…

    iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT

    Reply
  130. Hi,
    I have Nagios 4.0.1 on centos 6.5 , remote server is centos 6.4 . I am able to monitor that system through disk, cpu… and all existing plugins.

    I need to monitor mySql service also, so download check_mysql, dumped in /usr/local/nagios/libexec folder.
    When I am trying to run check_mysql then it is giving me error:
    (Return code of 127 is out of bounds – plugin may be missing)

    I have reinstalled plugins. still getting the error.

    Command.cfg:
    define command {
    command_name check_MySql
    command_line /usr/local/nagios/libexec/check_mysql -H -u root -p
    }

    Also, when running ./check_mysql command from terminal, it is giving me:

    [root@nagios libexec]# ./check_mysql
    ./check_mysql: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

    When I try to install libmysqlclient.so.18 , through yum, it says it is already available.

    Please help at the earliest.

    Reply
    • This may be due to check_mysql plugin is configured on the system that do not have same version of mysql-libs package installed. To workaround this problem, compile latest nagios-plugin under different directory say (/usr/local/nagios-new) without interrupting the default configuration. Once new plugins installed, backup old check_mysql plugin and replace it with new one. I hope this trick will slove your problem

      Reply
        • While compiling just add a specify location. For example, like this.

          # ./configure prefix=/usr/local/nagios2
          
          Reply
          • Hi Ravi,
            ./configure prefix=/usr/local/nagios2
            command did not created new directory. After ./configure I have also run make and make install command.
            I have downloaded check_myql file separetly on system. Please suggest if you have any authentic location where I can find these files,
            Besides, Mysql on Linux nagios client, I also need to monitor the following:
            Asterisk
            MS SQL
            Any Specific service in windows
            Any specific service in Linux (centOS)

            Please suggest.

        • mkdir /usr/local/nagios2

          i think it will create new directory. its better of creating this directory at very first and downloading all nagios and nrpe plugins to this directory. thats what i did.

          Reply
  131. Hello

    I have added to a Nagios client to the Nagios server but I’m gettting CHECK_NRPE: Error receiving data from daemon……

    When I checked the logs directory; I also found the error below

    CHECK_NRPE: Error – Could not complete SSL handshake

    nrpe daemon is unable to startup on the client machine. What is the probable course. Your help is very much appreciated.

    Thanks

    Reply
    • Have you started xinetd service? your nrpe port 5666 is opened on firewall? Please check these two things and come back to me with output.

      Reply
  132. Dear Ravi,

    Thanks for your very valuable tutorial. working very fine. But tell me how we will add images and logos to status map

    Regards.

    Reply
    • Dear Ravi,

      Thanks a lot for such wonderful article .i have configured as per your given steps and its working fine.

      Reply
  133. Hi Sir,

    having same problem facing as tanuj however i want to know arguments of check_http along with ftp and ssh

    Please help me in this regards

    —————–
    Thanks in advance
    Rameshan.O

    Reply
      • I am using Nagios, let me know nagios server and Client should be in same network..?

        my server is one network and client is another network, and status is CHECK_NRPE: Error – Could not complete SSL handshake.

        Reply
        • No that’s not the case, as far as both networks are reachable, you can have Nagios Server and Client on both networks. But make sure you open required ports as suggested in the article. The SSL handshake error, means the port 5666 is not opened at the client end, please open it and then try it.. it should connect.

          Reply
  134. Hi Sir,
    Please tell me the correct arguments for check_ftp and check_ssh?..

    —————–
    Thanks
    Anil

    Reply
  135. Hi Sir,

    You are quite right ..I found problem in services.cfg file and rectify those mistakes in that now the output of command :

    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg is

    Total Warnings: 0
    Total Errors: 0

    However when I am running “service nagios restart” command the output is shown below

    runuser: warning: cannot change directory to /home/nagios: No such file or directory
    Stopping nagios: [FAILED]
    Starting nagios: runuser: warning: cannot change directory to /home/nagios: No such file or directory
    [ OK ]

    please resolve this problem..

    Thanks
    Anil

    Reply
  136. Dear sir,

    I had made two configuration files hosts.cfg and services.cfg on Linux monitoring server however upon completion of above steps I am stuck at step ” verify Nagios Configuration files for any errors”.

    The output of command is shown below

    Nagios Core 4.0.1
    Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
    Copyright (c) 1999-2009 Ethan Galstad
    Last Modified: 10-15-2013
    License: GPL

    Website: http://www.nagios.org
    Reading configuration data…
    Read main config file okay…
    Error: Unexpected token or statement in file ‘/usr/local/nagios/etc/services.cfg’ on line 1.
    Error processing object config files!

    ***> One or more problems was encountered while processing the config files…

    Check your configuration file(s) to ensure that they contain valid
    directives and data defintions. If you are upgrading from a previous
    version of Nagios, you should be aware that some variables/definitions
    may have been removed or modified in this version. Make sure to read
    the HTML documentation regarding the config files, as well as the
    ‘Whats New’ section to find out what has changed.

    and
    here is my hosts.cfg file……

    ## Default Linux Host Template ##
    define host{
    name linux-box ; Name of this template
    use generic-host ; Inherit default values
    check_period 24×7
    check_interval 5
    retry_interval 1
    max_check_attempts 10
    check_command check-host-alive
    notification_period 24×7
    notification_interval 30
    notification_options d,r
    contact_groups admins
    register 0 ; DONT REGISTER THIS – ITS A TEMPLATE
    }

    ## Default
    define host{
    use linux-box ; Inherit default values from a template
    host_name client ; The name we’re giving to this server
    alias client.example.com ; A longer name for the server
    address 192.168.180.186 ; IP address of Remote Linux host
    }
    ~

    whereas the remote host name which I want to add to monitoring server is client.example.com and domain name is “example.com”..

    nagios monitoring server name ip –192.168.180.185
    hostname——server.example.com
    domainname—–example.com

    nagios remote hosts ip—–192.168.180.186
    hostname———client.example.com
    domainnaem——–example.com

    Kindly tell me where I am wrong …i.e. as per error message line no. 1 is correct as far as I know. Please help me in this regards.

    Thanks
    Anil

    Reply
    • The verification telling that there is a error in your services.cfg file at line no 1. Can you post the services.cfg file output here..

      Reply
  137. Hi sir,

    I just want to know where to create host.cfg and service.cfg i.e. on nagios host machine or at nagios monitoring server. Kindly reply Asap.

    —————
    Thanks
    Tanuj

    Reply
  138. Hi,

    I have followed the steps to configure nrpe on remote host and server. In the server I have installed nrpe correctly. But in this step: /usr/local/nagios/libexec/check_nrpe -H I get an error: bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory

    So I tried to go to path: /usr/local/nagios/libexec and did an ll, it doesn’t show check_nrpe. So I assume that check_nrpe is missing. When I googled for this issue, I found an option to create a symbolic lik for this and I did that. Now when I do an ll, I get this:
    check_nrpe -> /usr/lib/nagios/plugins/check_nrpe

    Yet, it doesn’t work. I have continued with the other steps and was successfully able to see this remote host in the Nagios Web Interface, Hosts and Services page. But I get an error in services as shown below (restapi is my remote linux machine:

    restapi

    CPU Load

    CRITICAL 05-21-2014 22:48:56 0d 0h 35m 52s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    Current Users

    CRITICAL 05-21-2014 22:50:00 0d 0h 34m 48s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    FTP Monitoring

    CRITICAL 05-21-2014 22:41:04 0d 0h 33m 44s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    SSH Monitoring

    CRITICAL 05-21-2014 22:42:08 0d 0h 32m 40s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    Total Processes

    CRITICAL 05-21-2014 22:43:12 0d 0h 31m 36s 3/3 (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, …) failed. errno is 2: No such file or directory

    PS: I again tried to install nrpe on this machine, but still loops to the same problem. As of now I have nrpe 1.4 and nrpe 1.5 installed. Please help me out on the next step, this is my first assignment at work.

    Reply
  139. hello sir, thank you for your explanation, I have problem in step 7 of your tutorial when I type make all it shows me this message
    make: *** No rule to make target <>. Stop.

    Reply
      • I solved the problem, but I’m falling into a new error in the monitoring server part I install the NRPE plugin successfully and I compile and install the NRPE addon successfully but when I want to check the NRPE daemon distance I make this command: / usr / local / nagios / libexec / check_nrpe-H local .

          it shows me bash :/ usr / local / nagios / libexec / cherck_nrpe: no file or folder of this type.

        I notice that it contains not check_nrpe in libexec.
        What is the problem?
        I did not understand well the order for the new iptables rule enrengistrer.
        please I am a beginner you can help me.
        thank you..

        Reply
  140. Hi Ravi

    Nice document really worth to follow

    im getting below error in services like;

    NRPE: Command ‘check_http’ not defined
    NRPE: Command ‘ping’ not defined
    NRPE: Command ‘check_ssh’ not defined
    PROCS CRITICAL: 664 processes

    Please suggest.

    Reply
    • The error clearly indicating that you haven’t defined these checks in nrpe.cfg file in remote host. Please add them in remote host nrpe.cfg file. For example to add these checks, add the following commands.

      # The following examples use hardcoded command arguments...
      
      command[check_http]=/usr/local/nagios/libexec/check_http -H 127.0.0.1
      command[check_ssh]=/usr/local/nagios/libexec/check_ping -H 127.0.0.1
      command[check_ftp]=/usr/local/nagios/libexec/check_ftp -H 127.0.0.1
      
      Reply
  141. Hi Ravi! Nice document, thank you!
    I have successfully setup my CentOS VPS as Nagios server, I want to monitor 2 boxes (Ubuntu & Debian) which both reachable on the same hostname xyz.mydomain.com from the internet, and I use port forwarding on the router…I have configured the Ubuntu nrpe on port 5666, it is running OK. But I also want to monitor the Debian which I have set up to listen on port 5667. Firewalls are open. How can I add in the hosts configuration, to check the second server on port 5667 intead of 5666?

    Reply
    • I have solved it by defining a non-standard check_nrpe command in commands.cfg for host2:
      # host one – default
      define command{
      command_name check_nrpe
      command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
      }

      # host two – non-standard port
      define command{
      command_name check_nrpe_host2
      command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5667 -c $ARG1$
      }

      and I call check_nrpe_host2!check_ftp for host two, for example in services.cfg…

      Reply
  142. Hi Ravi,
    Could you please share me the document to configure Websphere and Jboss servers to monitor them through Nagios and the process to configure their related plugins in detail.

    Regards,
    Sandeep.

    Reply
  143. Hello:
    I am having issues with Step 10: Customize NRPE commands

    I run this command on the Local box:

    /usr/local/nagios/libexec/check_nrpe -H localhost -c check_cciss
    and this is the output
    NRPE: Unable to read output

    Let me know what i am doing worng

    Reply
    • I have also done this command:
      # /usr/local/nagios/libexec/check_nrpe -H localhost -c check_users

      get response: NRPE: Unable to read output

      If I do this command:
      /usr/lib64/nagios/plugins/check_users -w 5 -c 10
      I get the normal reponse

      The only think I can think it is sudoers that causing my issue. But I never saw that in the steps posted on the iste

      Reply
      • I checked /var/spool/mail/root

        And these are the messages I get when running the command above:

        OMA-LAMP2.transgenomic.com : May 16 14:04:28 : nagios : parse error in /etc/sudoers near line 39 ; TTY=unknown ; PWD=/ ; COMMAND=/usr/local/nagios/libexec/check_users

        OMA-LAMP2.transgenomic.com : May 16 14:04:28 : nagios : no valid sudoers sources found, quitting ; TTY=unknown ; PWD=/ ; COMMAND=/usr/local/nagios/libexec/check_users

        Reply
        • It’s something permission problem, you need add the following line to sudoers file.

          # User privilege specification
          %nagios  ALL=(ALL)       ALL
          
          Reply
          • I made the change: I get this error:
            NRPE: Unable to read output

            I also checked in /var/log/messages this is what i am seeing:

            May 19 14:32:58 OMA-LAMP2 nrpe[2453]: Cannot write to pidfile ‘/var/run/nagios/nrpe.pid’ – check your privileges.
            May 19 14:32:58 OMA-LAMP2 nrpe[2453]: Network server bind failure (98: Address already in use)
            May 19 14:37:54 OMA-LAMP2 xinetd[1719]: Exiting…
            May 19 14:37:54 OMA-LAMP2 xinetd[2478]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
            May 19 14:37:54 OMA-LAMP2 xinetd[2478]: Started working: 1 available service
            May 19 14:39:33 OMA-LAMP2 xinetd[2478]: START: nrpe pid=2486 from=::1
            May 19 14:39:33 OMA-LAMP2 xinetd[2478]: EXIT: nrpe status=0 pid=2486 duration=0(sec)
            May 19 14:40:11 OMA-LAMP2 xinetd[2478]: START: nrpe pid=2492 from=::1
            May 19 14:40:11 OMA-LAMP2 xinetd[2478]: EXIT: nrpe status=0 pid=2492 duration=0(sec)

  144. Hi Ravi..

    I have configured the nagios, there is no error in nagios restart.But status is
    CHECK_NRPE: Error – Could not complete SSL handshake.

    Please help me..

    Reply
  145. Hii Ravi,
    Great Article and very succesfull steps you given us. Thanks alot.

    Could you guide us how to monitor any application server from the Nagios. Lets take an

    example of JBoss application server attributes.

    Thanks alot for your reply.

    Reply
  146. Hello Ravi ! Thank you for this awesome tutorial. I am using Nagios to monitor other hosts via GNS3 simulated MPLS Backbone ( the other hosts are located in differents sites).

    I tested this tutorial with a local machine (the remote machine) in the same network as the nagios server and I works perfectly. Unfortunately, I got that ” Could not complete SSL handshake ” error when I made tests with distant machines through the MPLS backbone. ( Pings between them via terminal works perfectly / both firewalls are down)

    Do you have any idea why ? Is there any specific configurations I must do in the backbone routers ?

    Reply
  147. Thanks alot Ravi, For your efforts, With your instructions i have installed Nagios on Linux.

    Now i have to monitor the tomcat and jboss servers from the same Machine where i

    have installed Nagios . Could please suggest an idea how can i proceed to do it ?

    Currently i have installed Nagios and able to accessible index page with the help of

    apache. Many Thanks for your assistance.

    Reply
  148. Hello Ravi,

    I have setup Nagios 3.2.3 and Added more than 20 servers. CPULoad and SSH status are different each server. But Memory Usage and Uptime are showing same for all the hosts. Could you please help me out on this. I am not sure what I am doing wrong.

    Here is the config file details

    define host{
    name mysvr ; Name of this template
    use generic-host ; Inherit default values
    check_period 24×7
    check_interval 5
    retry_interval 1
    max_check_attempts 10
    check_command check-host-alive
    notification_period 24×7
    notification_interval 30
    notification_options d,r
    contact_groups admins
    register 0 ; DONT REGISTER THIS – ITS A TEMPLATE
    }

    define host{
    use mysvr ; Inherit default values from a template
    host_name mysvr ; The name we’re giving to this server
    alias mysvr ; A longer name for the server
    address 192.168.0.100 ; IP address of the server
    }

    define service{
    use generic-service ; Name of service template to use
    host_name mysvr
    service_description Memory Use
    check_command chk_mem!75%!90%
    }

    define service{
    use generic-service ; Name of service template to use
    host_name mysvr
    service_description Uptime
    check_command check_uptime

    Regards,
    TechPlesk

    Reply
      • Hi Ravi,

        Can you Please any document reg NRPE services list , I want to monitor the remote linux server, But i dn’t know the what are the service list… So that please share

        Reply
        • Yes, I will be coming up with another article that describes how to add services in Nagios. Stay tuned for that.

          Reply
  149. hi Ravi sir

    can u send me all define service

    i m installed nagios 4.0.1 on ubuntu 12.04 .

    my mail server how to add and how to configure .

    Thanks Ejaz Sutar
    Con-9004470817

    Reply
  150. I am getting this error in my nagios monitoring tool for remote host

    DISK CRITICAL – /run/user/sayan/gvfs is not accessible: Permission denied

    I followed the steps in ubuntu page and tried to ignore the file in the remote host
    /etc/nagios-plugins/config/disk.cfg.Here is the view of my disk.cfg file

    ———————————————
    # ‘check_disk’ command definition
    define command{
    command_name check_disk
    command_line /usr/lib/nagios/plugins/check_disk -w ‘$ARG1$’ -c ‘$ARG2$’ -e -p ‘$ARG3$’ [-A -i ‘.gvfs’]
    }

    # ‘check_all_disks’ command definition
    define command{
    command_name check_all_disks
    command_line /usr/lib/nagios/plugins/check_disk -w ‘$ARG1$’ -c ‘$ARG2$’ -e [-A -i ‘.gvfs’]
    }

    ———————————————

    Where am I making mistake I don’t understand.

    Reply
  151. Hi Ravi…

    Thanks for this excellent document. I successfully added one host but in order to add another host to my server. i repeat the same steps everything goes right, but i am not able to view the newly added server(the second one) in my hosts.

    Any help is highly Appreciated..

    Thanks and Regards,

    Waseem

    Reply
  152. could you please help me how to add check_ssh,check_ftp and check_disk, in NRPE.conf file?
    i have added below lines but i am getting error…

    Entrys in nrpe.cfg

    command[check_ssh]=/usr/local/nagios/libexec/check_ssh -H 192.168.1.33
    command[check_disk]=/usr/local/nagios/libexec/check_disk -w 7% -c 3% -e -l
    command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1

    but i am getting below errors

    [root@kesava etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.33 -c check_ssh
    NRPE: Command ‘check_ssh’ not defined
    [root@kesava etc]# /usr/local/nagios/libexec/check_nrpe -H 192.168.1.33 -c check_disk
    NRPE: Command ‘check_disk’ not defined
    [root@kesava etc]#

    Reply
  153. I just installed Nagios Monitoring Server…

    but it seems some thing goes wrong ?

    Host Status : Down
    Message ” (No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_ping, …) failed. errno is 2: No such file or directory”

    help me to out from it…!!!

    Reply
    • See the directory /usr/local/nagios/libexec where you will find file named check_ping. if not then search for that file within your installation environment and put that file in this directory.

      Regards,
      Navneet Patel

      Reply
  154. Ravi really good tutorial…I was struggling from the past 48 hours and could get the remote host to be detected on my nagios monitoring host…followed your instructions and it is visible now….YOU ARE DA MAN….

    Reply
  155. Hi Ravi,

    Thanks a lot fr this smart tutorial!
    I installed both server and remote host agent successfully but the issue is I am accessing both the Monitoring server and its agent through ssh. So I am using elinks to open the url (http://ip_adress/nagios), its prompting for username and password.. after entering correct credentials it is showing me a page with title “Moved Permanently” and just below to it – “The document has moved here” . Could you please help me on this?

    Reply
  156. Hi,

    if we install some new plugin like (https://labs.consol.de/nagios/check_logfiles/) do we need to install in both systems (remote host and nagios monitoring server) ?

    if yes how to execute that plugin (check_logfiles)

    like below

    define service{

    check_commad check_nrpe!check_logfiles
    }

    define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

    }

    Reply
  157. Hi Ravi,

    I want to write API script for check_MK to show the stats from many applications from different servers.
    Can you please tell me how is this possible

    Thanks

    Reply
  158. i ravi,
    when i do the test if check_nrpe plugin can communicate with the NRPE daemon on my nagios server i find error:

    CHECK_NRPE: Socket timeout after 10 seconds.

    Reply
  159. Hello,

    I have installed nagios server and added a host in it. The nagios is checking only default checks. How can I add checks like httpd,mysql, exim. Please explain the steps.

    Thanks

    Reply
  160. Hi Ravi,

    please provide document for adding oracle database servers to nagios core…please give me full details about how to add databases to nagios and which plugin is used for monitoring databases…

    Thanks & Regards,
    Venu Alladi.

    Reply
  161. Hi, I have followed all your steps, and by running nagios
    sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
    It has the following result.
    Checking objects…
    Checked 13 services.
    Checked 2 hosts.
    Checked 1 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 25 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
    Checking for circular paths…
    Checked 2 hosts
    Checked 0 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
    Checking global event handlers…
    Checking obsessive compulsive processor commands…
    Checking misc settings…

    Total Warnings: 0
    Total Errors: 0

    However, the web interface it just still have one host and no remote hosts added.

    What’s the problem? Please help

    Reply
  162. Hi Ravi ,

    I went through the configuration and everything seems to be good, but when i open it in browser it prompts for credentials and i applied it and it opened but if select any of the tabs an getting the below error could u pls help me out.

    Thanks,

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    Apache/2.2.15 (Red Hat) Server at 192.168.25.82 Port 80

    Reply
  163. thanks Ravi Saive! the nagios monitoring interface is coming out finally.

    But I have got some alert in monitoring like below:

    FTP Monitoring NRPE: Command ‘check_ftp’ not defined

    SSH Monitoring NRPE: Command ‘check_ssh’ not defined

    PROCS CRITICAL: 567 processes

    please give me any solution

    thanks!

    Reply
  164. hello, I have got error sentance when I type this command below

    /usr/local/nagios/libexec/check_nrpe -H “remote IP”

    connect to address “remote IP”port 5666: No route to host

    but when I type the same command from the remote host, Its seems to be ok and the output is like this

    NRPE v2.15

    Reply
  165. Hi,

    Thanks a lot for the document, its easy to follow.
    Please help me i can run above commands and get the output in command line.

    eg : # /usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs

    PROCS CRITICAL: 297 processes
    # /usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs

    PROCS OK: 0 processes with STATE = Z

    all these commands work fine in command line.

    But when i view it in nagios

    http://localhost/nagios/

    i am not able to see any hosts.

    can you please help…..

    Reply
  166. hi ravi sir,
    I am trying to add linux remote host to nagios server, after configured nrpe plug-in in nagios server machine, while verify the NRPE daemon is functioning properly, I am getting this error,
    connect to address port 5666: No route to host
    connect to host port 5666: No route to host
    please help me on this.

    Reply
  167. Hi Ravi,

    we have a linux server where Nagious already installed and running fine. but recently we have added a new mount point due to the space issue.
    Now we just want to add that mount point to the nagious, What should i do now…
    Please help

    Reply
  168. I’m at the point of installing NRPE-plugin on the Nagios Monitoring Server. When I enter the ‘make all’-command, I get an error: ”’make: *** No rule to make target ‘all’. Stop”’.
    Why is that and how to resolve this?
    TIA.

    Reply
  169. Hi Ravi,

    I am new to Nagios please give me proper instruction to install the Nagios product….my question is where i install Nagios core and Nagios plugins and NRPE…i am trying to install all in one linux machine…..its ok. And give me suggestion to Nagios server?

    Thanks & Regards,
    Venu Alladi.

    Reply
    • Is there any errors showing on the screen while verified nagios configuration? Can you send me the screenshot of the error if possible?

      Reply
  170. hi. pls. disregard my previous post. I did find my mistake.. In hosts.cfg and services.cfg the details should be the remote host you want to monitor.

    In the hosts.cfg i got confuse at this line

    host_name tecmint ; The name we’re giving to this server

    I ended up putting the SERVER hostname.

    Thank you and God bless.

    Reply
  171. Hi. I believe i followed everything but I encounter an error during verifying Nagios Configuration files for any errors.

    Error: Could not find any host matching ‘NAGIOS_REMOTE (config file ‘usr/local/nagios/etc/services.cfg’, starting on line 8)
    Error: Failed to expand host list ‘NAGIOS_REMOTE’ for service ‘Total Processes’ (/usr/local/nagios/etc/services.cfg:8)
    Error processing object config files!

    What do I need to do. Thanks.

    Reply
  172. Hi Ravi

    When i Came to STEP-2 on Nagios Monitoring Server and typed this cmd “/usr/local/nagios/libexec/check_nrpe -H ”

    I get Below Mentioned Error:-

    /usr/local/nagios/libexec/check_nrpe: /lib/libssl.so.10: version `libssl.so.10′ not found (required by /usr/local/nagios/libexec/check_nrpe)

    What can i do. I did all things but still this error not Resolve.

    Please help me on priority basis.

    I will be very Thankful to you.

    Regards
    Sachin gahlawat

    Reply
  173. Hi all,

    while running the below command from nagios server i having the error.

    ./check_nrpe remote-ip

    CHECK_NRPE: Error – Could not complete SSL handshake.

    In both nagios server and remote client if i run the ./check_nrpe localhost
    It is working ,but from nagios server to remote client the command gives the above error.Please help me..thanks in advance

    Reply
  174. hi ravi,

    For me following error showing on nagios server:

    /usr/local/nagios/libexec/check_nrpe file is missing

    please help me with detailed steps

    Reply
      • Hi Ravi,

        I also posted same issue with another comment below. Please check and let me know what to do next. Issue: check_nrpe is missing in /usr/local/nagios/libexec/. Any help would greatly be appreciated. Thank you in advance!

        Reply
        • I could troubleshoot the issue. I found that check_nrpe was present in path /root/nagios/nrpe-2.14/src/
          So copied check_nrpe from this path to /usr/local/nagios/libexec/
          This solved the issue. Thanks anyway for the document. :)

          Reply
    • Hello Ravi Saive

      All steps were done exactly as you described. No matter what seems like your procedure is for an update due to all other plugins are within the directory except check_nrpe.

      The issue has been confirmed, you may take a couple of new servers and you get this point you will see what we are talking about. ( it has been also reported on NRPE Plugin 2.14 )

      Reply
  175. I am trying to check counters for a windows host using nrpe. I have it installed and I can run the command from the terminal on the nagios server, but I am a little unsure of the syntax required inside the .cfg file for the windows server.

    Command run from terminal fine:

    ./check_nrpe -H 192.168.1.xxx -p 5666 -c CheckCounter “Counter=\\PhysicalDisk(0 C: D:)\\% Disk Time” -a warn=80 crit=90 ShowAll

    Current command set up in the host config:

    check_nrpe!checkcounter!”Counter=\\PhysicalDisk(0 C: D:)\\% Disk Time” ShowAll

    (Please note I also have added an extra argument in my commands.cfg as -a $ARG2$

    I have also followed your steps above for Linux and windows hosts fine, and have basic checks like:

    check_nrpe!check_cpu

    This is running, but what is the syntax for showing the stats for this in the status information field? using check_nt would be:

    check_nt!CPULOAD!-l 5,80,90

    Reply
  176. one more try for the same issue…!!!
    Friends,
    I have installed the nagios by the above steps but I don’t know where I have did mistake
    It would be great help if you share me how to uninstall the nagios from my master and slave node…I’ll try freshly once again…
    Thanks in Advance…!!!

    Reply
  177. Friends,
    I have installed the nagios by the above steps but I don’t know where I have did mistake
    It would be great help if you share me how to uninstall the nagios from my master and slave node…I’ll try freshly once again…
    Thanks in Advance…!!!

    Reply
  178. after verifying my nagios.cfg, and i restart the nagios, it keeps tell stopping failed.
    do you have an idea to fix this issues

    Reply
  179. Hi, thanks for the guide, is very useful for Red Hat’s based systems

    Im using Centos 6.5 Final Realease, and im getting this error

    [root@localhost nrpe-2.15]# /usr/local/nagios/libexec/check_nrpe -H localhost
    CHECK_NRPE: Error – Could not complete SSL handshake.

    I’ve followed the guide as it’s explained but im stucked at this point. I guess it’s a problem with NRPE (looks obvious), however, i’ve looked in google and in some websites tells about NRPE as a service.

    Im understanding that NRPE was installed under Xinetd daemon, so it should be restarted when xinetd it’s; but it’s not happening. In fact when i try to do separately this is the result:

    [root@localhost ~]# service nrpe restart
    nrpe: unrecognized service

    Is there anything that i’ve done wrong? Could you help?

    When this error happened in Debian based systems such as Ubuntu, I checked the NRPE Installation. To the ./configure script i passed these values and it fixed in that moment, but not now

    ./configure –with-ssl=/usr/bin/openssl –with-ssl-lib=/usr/lib/x86_64-linux-gnu

    Thanks in advantage for any recommendation..

    Regards

    Reply
      • Yes, I’ve restarted the xinet service many times. However, checking accurately the command, i found the issue. The thing is;

        /usr/local/nagios/libexec/check_nrpe -H localhost

        When I did it on Ubuntu, I put instad of “localhost” “ip_address_of_host” so, for me the result always was successful

        [root@tecmint]# /usr/local/nagios/libexec/check_nrpe -H “localhost” or “172.16.120.10”

        NRPE v2.15

        I’ve checked that in Red Hat based systems’ is neccessary put “localhost” in nrpe file, it’s not enough putting 127.0.0.1 or “host_ip_address”, when i delete “localhost” from nrpe, then the error comes after command execution.

        Now, in my Ubuntu Nagios Server, the NRPE installed is v2.12. Im testing NRPE from nagios server to my Centos host v2.15 and it’s not connecting and this is the error

        Connection refused or timed out

        Firewall ports are opened, xinetd nrpe file was checked, could be a problem of nrpe version between 2.12 and 2.15?

        From the same way, i’ll keep checking other things. If you have some idea, please i’d like to read you.

        Thanks for the answer and thanks in advantage for any help that you can bring me.

        Regards

        Reply
        • Hi Ravi,

          Thanks for this post. I was able to successfully add a remote host but I cannot see it when I open the UI in the browser. Can you please let me know possible cause for the same.

          Regards,
          Rahul

          Reply
          • Hi Rahul,

            Am also getting the same problem have u found any solution for that, if yes kindly share with me also.

            thanks
            vijay

          • Thanks Vijay..it’s been complete 1 day, I was trying to resolve the issue and finally with your pointer. Issue resolved

  180. when i am installing cent os 6.4X86_64 then i am facing a problem.after creating partition when i click on next the error oucer and the error is( sytem try to mount image but image not found on drive please copy image on hard drive then click retry)
    so please provide solution for this error

    Reply
  181. As like comment from Alyson —

    when I was installing the NRPE comment on nagios server then getting —

    checking for initgroups… yes
    checking for closesocket… no
    checking for socklen_t… yes
    checking for type of socket size… size_t
    checking for SSL headers… configure: error: Cannot find ssl headers

    so due to this can’t find “check_nrpe” command from console on Nagios Server.

    Reply
  182. I’m following your document, and all went well until installing the NRPE plugin on the nagios server.
    I get down to Step 2. Add command:
    /usr/local/nagios/libexec/check_nrpe -H

    and I get this error message:
    -bash: /usr/local/nagios/libexec/check_nrpe: No such file or directory

    Looking in the directory, check_nrpe is not there. What did I do wrong?

    Regards,
    Alyson

    Reply
    • Hi Alyson

      Yes check_nrpe is not there . Please follow the steps which you followed to install NRPE on the remote host. You should follow the same steps on the nagios server as well

      Regards
      Manzoor

      Reply
      • Hello Alyson and Ravi Saive,

        I also got same error i checked and found that there is no /usr/local/nagios/libexec/check_nrpe check_nrpe file under libexec directory..

        To get this file what should i do please suggest me… !

        Thanks for your support…!

        Ashish Kumar Laxkar
        Linux System Admin

        Reply
  183. hi ravi

    am getting this error

    client.com

    CPU Load

    CRITICAL 12-11-2013 22:57:50 0d 1h 13m 56s 3/3 (Return code of 255 is out of bounds)

    Current Users

    CRITICAL 12-11-2013 23:00:22 0d 1h 12m 52s 3/3 (Return code of 255 is out of bounds)

    FTP Monitoring

    CRITICAL 12-11-2013 22:59:58 0d 1h 11m 48s 3/3 (Return code of 255 is out of bounds)

    SSH Monitoring

    CRITICAL 12-11-2013 23:03:26 0d 1h 10m 44s 3/3 (Return code of 255 is out of bounds)

    Total Processes

    CRITICAL 12-11-2013 23:02:30 0d 1h 9m 40s 3/3 (Return code of 255 is out of bounds)

    wt the host details i added to nagios getting (Return code of 255 is out of bounds) in status information

    Reply
  184. I have installed the nrpe plugins as mentioned on this page, still many commands fail
    like this one,

    Failure are seen on remote host itself
    # /usr/local/nagios/libexec/check_nrpe -H localhost -c check_swap
    NRPE: Command ‘check_swap’ not defined

    only commands that are running are check_load and check_users

    Reply
    • Yes!, you need to define those commands in remote Linux nrpe.cfg file and then add that check_swap command in Nagios Monitoring services file.

      Reply
  185. Hey guys..

    we have been using nagios since years and I must say, there is no better tool than nagios for monitoring. However, i was wondering if there is any automated script that will allow us to add new hosts to localhost.cfg, instead of manually editing that file? Is there any web interface or script to make this task simple?
    thanks for your help in advance.!

    Reply
  186. hai ravi,

    i got error message Warning: Duplicate definition found for host ‘mphs’ (config file ‘/usr/local/nagios/etc/objects/localhost.cfg’, starting on line 24)
    Error: Could not add object property in file ‘/usr/local/nagios/etc/objects/localhost.cfg’ on line 28.
    Error processing object config files!
    what can i do please give me a solutions

    -pandiyan

    Reply
    • It seems that you’ve added duplicate entry in localhost.cfg file, remove that ‘mphs’ on line 24 from localhost.cfg file and try to restart again.

      Reply
  187. Can any one pls let em know after the installation of the nagios plugin we can monitor the remote servers but can the nagios plgins be used to do a file transfer a remote sftp server ?? is it possible to transfer a file from our system toa remote sftp server by using ftp protocol if the nagios plugin is installed in my system ??
    pls reply

    Reply
      • Thanks for your response, I need to transfer the files to remote sftp server from my windows xp pc ,so i need to execute the installation steps what you have suggested above in the remote sftp server to which i need to monitor and establish the connection is my understanding right ??

        Reply
    • Hello,

      I have configured it but host is still down in nagios. Some of the checks are working . Like user,load. How to add more checks?. How to make host alive.

      Thanks

      Reply
  188. It produces the following error

    connect to address port:5666 Connection refused
    connect to host port:5666: Connection refused

    when we use the command /usr/local/nagios/libexec/check_nrpe -H

    For ipaddress i have used 192.168.1.98 in which i had configure the nagios server

    How can we solve this error

    Reply
      • Hi Ravi,

        Suppose if i need to monitor a remote sftp server do i need to do this installation only on that server which i need to monitor.

        My requirement is to monitor a remote sftp server and transfer the files with FTP protocol to that server my from my computer

        thanks

        Reply
          • So if i can install the nagios plugins and the NRPE on the remote sftp server which i want to monitor can i perform the file transfer as well or do i need to install any additional software along with nagios to do the FTP ??

  189. Is it possible to make nrpe copy the plugins everytime it runs? I need to redistribute custom checks every time in order to keep them up to date.

    Reply
  190. Thanks boss the info u set here lead me to a great way to complete mine and understand what i am working on thanks for the useful info

    Reply
  191. Hi Ravi,

    I have configured everything properly. But after login with nagiosadmin to check hosts status it shows following error :

    It appears as though you do not have permission to view information for any of the hosts you requested…

    If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file.

    I have checked /usr/local/nagios/etc/cgi.cfg file, all entires are fine with nagiosadmin and checked /etc/httpd/conf.d/nagios.conf file also seems fine. But I don’t know where Im doing wrong.

    Hope an early response from you.

    Thanks & Regards

    Vasu

    Thanks

    Reply
    • Solution, open your cgi.cfg file and change all the below parameters to the user you set to permit viewing.

      use_authentication=1
      #edit username
      authorized_for_all_host_commands=username
      authorized_for_all_hosts=username
      authorized_for_all_service_commands=username
      authorized_for_all_services=username
      authorized_for_configuration_information=username
      authorized_for_system_commands=username
      authorized_for_system_information=username
      

      Restart the Nagios service after making changes in the cgi.cfg file.

      Reply
    • Hi Ravi,

      Its working now. Again checked these two files /usr/local/nagios/etc/cgi.cfg and /usr/local/nagios/etc/objects/contacts.cfg for errors and configured once again.

      Please add one more command on Nagios Monitoring Server at step 1 below
      # make install-daemon
      # make install-plugin

      Thanks

      Reply
  192. Hi Ravi,

    Excellent tutorial. One small clarification is, the host_name mentioned in services.cfg file is Remote machine host name ?

    Thnaks

    Reply
          • ok,thanks,but the remote host monitoring is not working.

            the monitoring server is showing values of the localhost only.

            do i need to turn off firewall or add an exception to allow the server to communicate to the host machine for monitoring.
            If so, how to add the exception.

      • Hello Ravi,

        I’ve added a new hosts.cfg, services.cfg and hostgroups.cfg. Then new lines in nagios.cfg (path to the new cfg_file) and finally verified my configurations… No Warning and errors detecter.. The number of hosts and services showed while reading the main config file are corrects. But still i don’t see the hosts and services in WebUI.. When i’ve tried to generate and restart nagios through the WebUI i’ve notice that it doesn’t take all new hosts and services… What should i do? Thank you in advance

        Reply
    • Dear Sir,

      i want SSH Server for torrent plz your contact no: ……………………..

      Thanks and regards,

      NARESH.E

      Sri Login Broadbands,

      Ph-9052259993

      Reply
      • What you mean? can’t understand your question, can you put some more information..about what you looking for..

        Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.