NSClient++ is a windows service open source program, also called NSCP  its an monitoring agent that allows easier to gathered by nagios. This post describe how to monitoring windows services from Nagios. Nagios server installed in Linux operating system and monitoring a windows server.

How to Install :

Download the latest Nagios NSClient++ package  from the link

Now setup the nsclinet++ 64 bit version,

Click on " Next " button



 Now, enter your Nagios server IP Address and ensure that  " Modules to load ", Click on " Next "



Install nsclinet.ini configue file, click on " Next ".



 Now installing in your server,



Finally click on  " Finish " button,



 If you need any changes can update in nsclient.ini file,  its located in C:\Program Files\NSClient++

How to Configure in Nagios Server:


Open localhost.cfg and add the below line,
 
# vim /usr/local/nagios/etc/objects/localhost.cfg

#####Members######
define hostgroup{
        hostgroup_name  Windows-Servers
        alias           Windows-Servers
        members         host.domainname.com
        }

Create a .cfg file for windows on same directory and add the below lines,
 
# vim /usr/local/nagios/etc/object/host.domainname.cfg

define host{
        use                     Windows-Server
        host_name               host.domainname.com
        alias                   domain
        address                 192.168.1.10 #Windows Server IP Address
        }

define service{
use                     generic-service
host_name               host.domainname.com
service_description     NSClient++ Version
check_command           check_nt!CLIENTVERSION
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     Uptime              #Uptimes    
check_command           check_nt!UPTIME
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     CPU Load              
check_command           check_nt!CPULOAD!-l 5,80,90   #Looking  CPU usage
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     Memory Usage
check_command           check_nt!MEMUSE!-w 85 -c 90  #Looking  Memory Usage
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     C:\ Drive Space
check_command           check_nt!USEDDISKSPACE!-l c -w 85 -c 90 # Looking  disk space  C: dirve
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     D:\ Drive Space
check_command           check_nt!USEDDISKSPACE!-l d -w 85 -c 90  # Looking   disk space D: drive
}

define service{
use                     generic-service
host_name               host.domainname.com
service_description     W3SVC
check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

Error :

Free disk space : Invalid drive

Solution :

If the above error message showing on Nagios monitoring check your partition name (C:, D:, E:) in Nagios.

define service{
use                     generic-service
host_name               host2.dnsrain.com
service_description     D:\ Drive Space
check_command           check_nt!USEDDISKSPACE!-l d -w 85 -c 90


Finally check the Nagios configuration is perfectly right and restart it,
 
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

# /etc/init.d/nagios  restart