Configuration of Windows Host on Nagios using NSCLIENT++

To monitor Windows machine services using the Nagios monitoring tool you required an agent that need to be installed on windows client. It acts as a proxy between the Nagios server and  Windows machine. The installation procedure can be followed as:

Steps :

Step 1 : At first check for configure task .i.e  .cfg files which allow you to use check_nt plugin to monitor windows machine and the config files can be found in the directory

Step 2 : Edit the windows.cfg file as per your requirement.

Step 3 : Now on the client side you need to install NSClient++ which works as a gateway between Nagios server and windows client.

Step 4 : If you have provided password while configuring NSClient on windows then you have to modify

Step 5 : Finally restart the nagios server

Let us see the steps in Details :

Step 1 : At first check for configure task .i.e  .cfg files which allow you to use check_nt plugin to monitor windows machine and the config files can be found in the directory

 /usr/local/nagios/etc/objects/ 

Edit the Nagios main config file

#vi /usr/local/nagios/etc/nagios.cfg

Uncomment the line that is used to monitor windows machine

cfg_file=/usr/local/nagios/etc/objects/windows.cfg

Then save and exit

Step 2 : Edit the windows.cfg file as per your requirement:

#vi /usr/local/nagios/etc/objects/windows.cfg

 HOST DEFINITIONS##################################################################### Define a host for the Windows machine we’ll be monitoring# Change the host_name, alias, and address to fit your situationdefine host{
use                    windows-server                        ; Inherit default values from a template
host_name       winserver               ; The name we’re giving to this host
alias           solutionsatexperts-Windows; A longer name associated with the host
address         192.168.1.8               ; IP address of the host
}HOST GROUP DEFINITIONS
##################################################################### Define a hostgroup for Windows machines# All hosts that use the windows-server template will automatically be a member of this groupdefine hostgroup{
hostgroup_name  windows-servers            ; The name of the hostgroup
alias                   solutionsatexperts-Windows; Long name of the group
}SERVICE DEFINITIONS
####################################################################
# Create a service for monitoring the version of NSCLient++ that is installed
# Change the host_name to match the name of the host you defined above
define service{
use                         generic-service
host_name               winserver
service_description    NSClient++ Version
check_command       check_nt!CLIENTVERSION
}

# Create a service for monitoring the uptime of the server
# Change the host_name to match the name of the host you defined above
define service{
use                         generic-service
host_name               winserver
service_description   Uptime
check_command       check_nt!UPTIME
}

# Create a service for monitoring CPU load
# Change the host_name to match the name of the host you defined above
define service{
use                          generic-service
host_name                winserver
service_description    CPU Load
check_command        check_nt!CPULOAD!-l 5,60,60
}

# Create a service for monitoring memory usage
# Change the host_name to match the name of the host you defined above

define service{
use                          generic-service
host_name                winserver
service_description    Memory Usage
check_command        check_nt!MEMUSE!-w 50 -c 70
}

# Create a service for monitoring C:\ disk usage
# Change the host_name to match the name of the host you defined above

define service{
use                         generic-service
host_name               winserver
service_description   C:\ Drive Space
check_command       check_nt!USEDDISKSPACE!-l c -w 60 -c 70
}

# Create a service for monitoring the W3SVC service
# Change the host_name to match the name of the host you defined above

define service{
use                         generic-service
host_name               winserver
service_description   W3SVC
check_command       check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

# Create a service for monitoring the Explorer.exe process
# Change the host_name to match the name of the host you defined above

define service{
use                         generic-service
host_name               winserver
service_description    Explorer
check_command        check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}

Then save and exit.

Step 3 : Now on the client side you need to install NSClient++ which works as a gateway between Nagios server and windows client.

Install the windows agent on windows machine. Download nsclient++addon which will be found at http://sourceforge.net/projects/nscplus/.

Double click to Start the installation process then follow the process like:

NEXT accept terms in the agreement

 

 

 

 

 

 

 

 

 

 

NEXT configure host by assigning ip of the nagios server then select enable check plugins, enable nsclient server(check_nt) and enable wmi checks

After this INSTALL and then FINISH

Goto START MYCOMPUTER right click goto MANAGE SERVICES AND APPLICATION goto

SERVICES

In services search for NSClient++ and click on to open a NSClient++ properties

goto LOG ON select the check box  “Allow all service to interact with desktop” APPLY OK

Step 4 : If you have provided password while configuring NSClient on windows then you have to modify

#vi /usr/local/nagios/etc/objects/commands.cfg

# ‘check_nt’ command definition

define command{

        command_name    check_nt

        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s root -v $ARG1$ $ARG2$

        }

Step 5 : Finally restart the nagios server

#service nagios restart

and log on to web interface with your nagios server IP address

http://192.168.1.4/nagios/

After login you can check the services that are being monitored by Nagios server and can be seen below:

Thanks for watching.

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk