devilbuqi 2014-11-24
参考 : http://www.mamicode.com/info-detail-135011.html
http://blog.chinaunix.net/uid-24960107-id-1569675.html
http://yahoon.blog.51cto.com/13184/41897/
先前我们讲到要控制远端Linux主机需要用到 NRPE,那 Win主机呢,需要的就是NSClient++这个东西了 ...
1. 如何 安装 NSClient
2. 检查NSClient服务是否启动正常
3. 进入 services.msc 查看 nsclient++服务是否 为自动启动;
4. 关于nsclient++的配置文件
5.最后记得防火墙,步骤2中 的服务端口 一定要记得开放....
------------------ 华丽的分割线 ------------------------
上面5步就完成了win主机被控端的设置 , 下面我们看看在控制端如何去监控信息...
多的不说了,直接上代码及图
############# # COMMAND define command { command_name check_nt_bbt command_line /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -p 12489 -v '$ARG1$' -l '$ARG2$' -d '$ARG3$' } define hostgroup { hostgroup_name BBT-TEST-WIN alias BBT TEST SERVER FOR WIN members win-220 } # HOST define host{ use generic-host host_name win-220 alias 10.10.10.220 address 10.10.10.220 hostgroups BBT-TEST-WIN } # win system define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description Systme Uptime check_command check_nt_bbt!UPTIME } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description Cpu Load check_command check_nt_bbt!CPULOAD!5,80,90 } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description Mem Use check_command check_nt_bbt!MEMUSE!-w 80 -c 90 } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description Monitoring C check_command check_nt_bbt!USEDDISKSPACE!c } # win service define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description OEBBTServer check_command check_nt_bbt!SERVICESTATE!OEBBTServer!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description OEMySql check_command check_nt_bbt!SERVICESTATE!OEMySql!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description memcached Server check_command check_nt_bbt!SERVICESTATE!memcached Server!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description tvnserver check_command check_nt_bbt!SERVICESTATE!tvnserver!SHOWALL } # win process define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description OeRunServer.exe check_command check_nt_bbt!PROCSTATE!OeRunServer.exe!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description httpd.exe check_command check_nt_bbt!PROCSTATE!httpd.exe!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description memcached.exe check_command check_nt_bbt!PROCSTATE!memcached.exe!SHOWALL } define service{ use generic-service hostgroup_name BBT-TEST-WIN service_description tvnserver.exe check_command check_nt_bbt!PROCSTATE!tvnserver.exe!SHOWALL }