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

Click on Complete setup type

Select the permissions on nsclient++ configuration file

Enter Nagios server ip in Allowed Hosts and enter password

Click on Install button

Finish Installation

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.

Share.

6 Comments

  1. Vishal Sapkal on

    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

  2. Microsoft Support Canada on

    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.

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

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

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

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

Exit mobile version