5.监控端主机的设定:
● libexec 下须要 check_nt 执行程序。
● 设定 commands.cfg
增加:
# 'check_nt' windows client command definition for remote service
define command{
command_name check_nt
command_line $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
}
● 设定主要监控项目 service.cfg
# 监控 windows 主机的开机运作时间
define service{
use remote-service ; Name of service template to use
hostgroup_name windows-servers
service_description System Uptime
check_command check_nt!UPTIME
}
# 监控 windows 主机的 CPU 负载
define service{
use remote-service ; Name of service template to use
hostgroup_name windows-servers
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}
监控 windows 主机的内存使用状况
define service{
use remote-service ; Name of service template to use
hostgroup_name windows-servers
service_description Memory usage
check_command check_nt!MEMUSE!-w 80 -c 90
}
监控 windows 主机的 C:\ 的空间使用量
define service{
use remote-service ; Name of service template to use
hostgroup_name windows-servers
service_description c:\ - total
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}
另外还有:
监控 windows 主机的 MSSQLSERVER 服务的运作状况,如服务终止了,则会发 CRITICAL
check_command check_nt!SERVICESTATE!-d SHOWALL -l MSSQLSERVER
监控 windows 主机的 Explorer.exe 执行程序的运作状况,如程序终止了,则会发 CRITICAL
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
6.问题排除
2008-02-12 17:44:24: error:.\PDHCollector.cpp:99: Detected language: 0x0404 but it could not be found in: counters.defs
2008-02-12 17:44:24: error:.\PDHCollector.cpp:100: You need to manually configure performance counters!
● 初步安装好时, NSClient++ 会有上述的错误,原因是操作语系的问题,NSClient++ 默认支持 OS 的语言并不多,所以这部份须进行手动配置,检示错误讯息为「0x0404」这个语系,直接复制「English US」这个项目内所有的数据,以「0x0404」这个语系取代,如下:
修改 C:\NSClient++ 下 counters.defs 这个档案
[0x0404]
Description = "Chinese BIG5"
NT4_SystemTotalProcessorTime = "\System\% Total Processor Time"
NT4_SystemSystemUpTime = "\System\System Up Time"
NT4_MemoryCommitLimit = "\Memory\Commit Limit"
NT4_MemoryCommitByte = "\Memory\Committed Bytes"
W2K_SystemTotalProcessorTime = "\Processor(_total)\% Processor Time"
W2K_SystemSystemUpTime = "\System\System Up Time"
W2K_MemoryCommitLimit = "\Memory\Commit Limit"
W2K_MemoryCommitByte = "\Memory\Committed Bytes"
● 修改完后,重开 NSClient++ 即可