1. Install nsclient++
Visit the http://nsclient.org/nscp/download nsclient++, where I am using the nsclient++-0.3.9-x64 MSI installation package. After downloading directly installs, will prompt to enter Nagios to monitor the server address and the password in the process. The address is filled in correctly and the password is not set. Nagios monitoring Server in advance to monitor the Linux server has been built, and then share with you.
Install the following image:
2. Configure nsclient++
Edit the Nes.ini file under the installation directory and open the nsclient++ port. method to find:
[Nsclient]
;p ort=12489
Remove the ";" before the port. You can enable Port 12489.
Mine is installed in the nsclient++-win32-0.3.9 directory under the server's program files. Executing in cmd:
CD C:\Program files\nsclient++-win32-0.3.5
Netstat-an | More
Check to see if port 12489 is listening properly.
Because the modules required for installation are already checked, the configuration file does not need to be set. Otherwise, you can enable the module by removing it from the front of each module.
This completes the configuration on Windows Server 2008. Next we set up the Nagios monitoring server.
3.Nagios Monitor Server settings
Vi/usr/local/nagios/etc/nagios.cfg
Search Find:
# Definitions for monitoring a Windows machine
# cfg_file=/usr/local/nagios/etc/objects/windows.cfg
Remove the second line of # to open the Windows module for Nagios monitoring and save it.
Then edit
# vi/usr/local/nagios/etc/objects/windows.cfg
Locate and set up a monitored server:
Define Host{
Use Windows-server; Inherit default values from a template
HOST_NAME Winserver; The name we ' re giving to this host
Alias my Windows Server; A longer name associated with the host
Address 192.168.0.2; IP Address of the host
}
Set the monitored host name and the Windows Server address that is being monitored.
Next, search for a variety of monitored services and set:
# Create A service for monitoring the version of nsclient++ this 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
}
Monitor the nsclient version.
# 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
}
Monitor server online time.
# 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 20,30,50
}
Monitor server CPU load.
# 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 80-C 90
}
Monitor the memory footprint of the server.
# 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 80-c 90
}
Monitor system C disk occupancy.
After deployment, it is shown in Nagios as follows: