Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Monitoring Tools»Nagios»How to Monitor Remote Windows Host using Nagios

    How to Monitor Remote Windows Host using Nagios

    By RahulSeptember 21, 20193 Mins Read

    Nagios is most powerful infrastructure monitoring tools. Our earlier articles describes nagios core service installation and configure nagiosql with nagios core server. In this articles we are going to configure windows hosts to be monitor by Nagios server.

    Advertisement

    Similar to NRPE service on Linux, NSClinet++ is the service for windows hosts to monitor through check_nrpe from nagios server. “How to Install and Configure NSClient++ and Monitor Remote Windows Host”

    Step 1 – Install NSClient++

    Download the latest version of NSClient from its official site and start installation as below. The software will be named NSCP-xxxxxx.msi. During the installation process, you would require to enter the Nagios server to allow the server to connect the client through NRPE.

    START the installation

    nsclient-1

    Accept the license terms and click Next

    nsclient-2

    Click on Complete setup type

    nsclient-3

    Select the permissions on nsclient++ configuration file

    nsclient-4

    Enter Nagios server ip in Allowed Hosts and enter password

    nsclient-5

    Click on Install button

    nsclient-6

    Finish Installation

    nsclient-7

    Step 2 – Verify Connectivity from Nagios Server

    After installing NSClient++ on your system. Let’s verify that your nagios server is properly connecting to windows client through nrpe service. To do this login to your nagios server and run following command. For example my windows client ip is 192.168.1.10.

    /usr/local/nagios/libexec/check_nrpe -H 192.168.1.10
    
    [Sample Output]
    I (0,4,1,105 2014-04-28) seem to be doing fine...
    

    You Nagios client setup has been completed on your windows host. Now you can add this host in Nagios server.

    Step 3 – Adding Host in Nagios Server

    We recommend using NagiosQL3 for configuration Nagios. It provides a user-friendly web interface for managing your Nagios service. In case you are not using nagiosql and want to add your host in Nagios server.

    Create a configuration file /usr/local/nagios/etc/servers/MyWindowsHost001.cfg using below values. for example you windows hosts ip is 192.168.1.10. We also need to define a service with host. So add a ping check service, which will continuously check that host is up.

    #########################################################
    # Windows Host 001 configuration file
    #########################################################
    
    define host {
            use                          windows-server
            host_name                    Windows_Host_001
            alias                        Windows Host 001
            address                      192.168.1.10
            register                     1
    }
    define service{
          host_name                       Windows_Host_001
          service_description             PING
          check_command                   check_ping!100.0,20%!500.0,60%
          max_check_attempts              2
          check_interval                  2
          retry_interval                  2
          check_period                    24x7
          check_freshness                 1
          contact_groups                  admins
          notification_interval           2
          notification_period             24x7
          notifications_enabled           1
          register                        1
    }
    
    
    #########################################################
    # END OF FILE
    #########################################################
    
    

    Now verify configuration files using following command. If there are no errors found in configuration, restart nagios service.

    nagios -v /usr/local/nagios/etc/nagios.cfg
    service nagios restart
    

    Now open your nagios web interface and check for new hosts added in nagios core service. In my case, it looks like below.

    add-host-in-nagios

    nagios NRPE nsclient windows
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Clear the ASP.NET Temporary files in Windows

    How to Enable / disable Firewall in Windows

    Check Windows Uptime

    How to Check Computer Uptime in Windows

    View 6 Comments

    6 Comments

    1. Vishal Sapkal on August 15, 2019 7:06 am

      Hi Rahul ji,

      Windows server added for monitoring but getting error NSClient – ERROR: Invalid password.

      Which password? have to set in nsclient.ini.

      Regards,
      Vishal

      Reply
    2. Microsoft Support Canada on June 20, 2018 9:31 pm

      Nagios is used for monitoring. It is said that it is the most powerful tools for monitoring.we can monitor remote windows host by using the Nagios server.so it is really useful. but to do that we have to configure first the windows host for the monitoring.try it out.

      Reply
    3. H2O on October 30, 2017 8:12 pm

      add cfg_dir=/usr/local/nagios/etc/servers/MyWindowsHost001.cfg in nagios.cfg file and then restart nagios service.

      Reply
      • Rahul K. on October 31, 2017 7:02 am

        Hi, use directory path with cfg_dir configuration variable in nagios.cfg like:

        cfg_dir=/usr/local/nagios/etc/servers

        Reply
    4. ice on November 5, 2015 3:08 pm

      I followed your every instruction perfectly, but still its not working. It’s showing connection refused error.
      What should I do please help me. Thanks in advance.

      Reply
    5. Tess on July 29, 2015 10:17 pm

      I followed your instructions and everything seemed to work fine, but the Windows server isn’t showing up as a host on the Nagios web interface. I didn’t install nagiosql, but should that be a problem? Thanks in advance!

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.