`
hongliangpan
  • 浏览: 313060 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Windows 下 NSClient++ 的建置

阅读更多
Windows 下 NSClient++ 的建置

1.取得最新版本:(Download)

Windows Client 端「NSClient++」:NSClient++-Win32-0.3.0.zip(NSClient++-Win32-VERSION.zip)
架构如下:


参考官方网页
http://nagios.sourceforge.net/docs/3_0/monitoring-windows.html

2.解压缩 NSClient++-Win32-0.3.0.zip

于 C:\ 下解压缩为 C:\NSClient++

3.安装 NSClient++

开启 cmd,切换到 C:\NSClient++,执行 NSClient++ /install 进行安装

执行 NSClient++ SysTray install 注意大小写,这一步是安装系统小图标


4.编辑 C:\NSClient++ 下的 NSC.ini 文件

[modules] 中,所有的 .dll 注释都全都去掉,除了 CheckWMI.dll and RemoteConfiguration.dll
[Settings] 中,'password' 这个项目是在设置密码,作用是在 nagios 监控主机进行联机时,要求提供密码才能进一步进行联机,这里为了方便起见,跳过它,不要设定密码。
[Settings] 中,'allowed_hosts' 选项的 mark 去掉,并且加上 nagios 的监控主机的 IP,修改如下 allowed_hosts=127.0.0.1/32,192.168.0.11 以逗点相隔。
[NSClient] 中,'port' 选项的 mark 须要拿掉,并且它的值是 '12489',这是 NSClient 的预设 port

● 设定完成之后,启动 NSClient++

在 cmd 中 C:\NSClient++ 下,执行 NSClient++ /start


在 cmd 下,执行 netstat -an ,检查 port 12489 是否开启


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++ 即可

分享到:
评论
1 楼 dinguaa 2009-06-11  
安装这个有什么用?

相关推荐

Global site tag (gtag.js) - Google Analytics