1. Download and install the Windows plugin Http://sourceforge.net/projects/nscplus/NSCP-0.4.1.73-x64.msi
2. Windows-side configuration Nsclient.ini file
[/modules]
; CHECKWMI = 1 #注释掉该行
[/settings/default]
Allowed hosts = *
;p Assword =
Port = 12489 #该行为手工添加
3. Server-side configuration commands.cfg
Define Command{
Command_name check_nt
Command_line $USER 1$/check_nt-h $HOSTADDRESS $-P 12489-v $ARG 1$ $ARG 2$
}
command-line parameters can be consulted:/usr/lib/nagios/plugins/check_nt-h
4, Configuration Hosts.cfg
Define host {
HOST_NAME AAA
Alias AAA
Address 192.168.1.190
Contact_groups itservices
Check_command check-host-alive
Max_check_attempts 5
Notification_interval 10
Notification_period 24x7
Notification_options D,u,r
}
5, Configuration Services.cfg
#host---AAA
Define Service{
HOST_NAME AAA
Service_description check-host-alive
Check_command check-host-alive
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description CPU Load
Check_command check_nt! Cpuload!-l 5,80,90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description Memory Usage
Check_command check_nt! Memuse!-w 80-C 90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description Onlinetime
Check_command check_nt! UPTIME
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description c \ Drive Space
Check_command check_nt! Useddiskspace!-l C-w 80-c 90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description D:\ Drive Space
Check_command check_nt! Useddiskspace!-l D-w 80-c 90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description w3svc
Check_command check_nt! servicestate!-d showall-l W3SVC
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description Explorer
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description c \ Drive Space
Check_command check_nt! Useddiskspace!-l C-w 80-c 90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description D:\ Drive Space
Check_command check_nt! Useddiskspace!-l D-w 80-c 90
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description w3svc
Check_command check_nt! servicestate!-d showall-l W3SVC
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
Define Service{
HOST_NAME AAA
Service_description Explorer
Check_command check_nt! procstate!-d showall-l Explorer.exe
Check_period 24x7
Max_check_attempts 5
Normal_check_interval 3
Retry_check_interval 2
Contact_groups itservices
Notification_interval 10
Notification_period 24x7
Notification_options W,u,c,r
}
5. Restart Nagios and httpd services
6. Errors encountered:
Windows Nsclient.log "source\nscp\trunk\include\check_nt/server/protocol.hpp:65:rejected connection from:", Check that the Nsclient.ini and COMMANDS.CFG interfaces are consistent
Nagios Monitors Windows configuration