How to Add Windows Host to Nagios Monitoring Server

How to Add Windows Host to Nagios Monitoring Server

Nagios is most powerful infrastructure monitoring tools. In this articles we are going to configure windows hosts to be monitor by Nagios server.

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: Download and 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 installation process, you would require to enter nagios server to allow server to connect nsclient through nrpe.

START the installation using .msi file

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 using Configuration File

We recommend to use 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.

 
Enjoyed this video?
"No Thanks. Please Close This Box!"