1、下载并安装windows插件 http://sourceforge.net/projects/nscplus/NSCP-0.4.1.73-x64.msi
2、windows端配置 nsclient.ini文件
    [/modules]
    ;CheckWMI = 1   #注释掉该行
    [/settings/default]
    allowed hosts = *
    ;password =
     port = 12489   #该行为手工添加
3、服务器端配置commands.cfg
 define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489  -v $ARG1$ $ARG2$
        }
      命令行参数可参考: /usr/lib/nagios/plugins/check_nt -h
4、配置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、配置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、重启nagios和httpd服务
6、遇见的错误:
  windows下nsclient.log里有“source\nscp\trunk\include\check_nt/server/protocol.hpp:65: Rejected connection from:”,检查nsclient.ini与commands.cfg 接口是否一致

最新文章

  1. js事件流
  2. jquery制作论坛或社交网站的每天打卡签到特效
  3. Python中的对象类型的初步介绍
  4. Intention.js – 动态重构 HTML 为响应式模式
  5. Oracle 【IT实验室】数据库备份与恢复之一:exp/imp(导出与导入&装库与卸库)
  6. .Net MVC 导入导出Excel总结(三种导出Excel方法,一种导入Excel方法) 通过MVC控制器导出导入Excel文件(可用于java SSH架构)
  7. iOS-网络请求-AFN升级至AFN3.0
  8. Swift 学习笔记第一天-变量常量,及数据类型
  9. m球求n盒子问题
  10. redis3.0集群搭建
  11. ArrayList-VS-LinkedList
  12. .net core nlog记录日志
  13. Python爬取糗事百科
  14. MySql Outer Join 简单化
  15. 使用 C# (.NET Core) 实现模板方法模式 (Template Method Pattern)
  16. Comparable和Comparator接口是干什么的?列出它们的区别。
  17. jQuery bind() live()
  18. 对Neural Machine Translation by Jointly Learning to Align and Translate论文的详解
  19. AI生万物,新世界的大门已敞开
  20. JSR310 时间类型的相互转换

热门文章

  1. IPv4(三)地址掩码
  2. TOML简介 (转)
  3. 数据库ACID操作---事务四原则
  4. Android OkHttp的Cookie自己主动化管理
  5. 【BZOJ2406】矩阵 二分+有上下界的可行流
  6. 【BZOJ1604】[Usaco2008 Open]Cow Neighborhoods 奶牛的邻居 Treap+并查集
  7. Tomcat学习笔记【4】--- Server.xml配置文件详解
  8. 【题解】CJOI2019 登峰造鸡境 (Prufer序列+斯特林数)
  9. 【题解】UVA10140 [Prime Distance]
  10. Flask:模板