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 Comments

Leave a Reply
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. /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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. Hi Sir,
    Please tell me the correct arguments for check_ftp and check_ssh?..

    —————–
    Thanks
    Anil

    Reply
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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)

  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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

  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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 ??

  80. 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
  81. 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
  82. 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
  83. 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.