Nagios 远程监控 (win)

参考 :  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

写道
从http://www.nsclient.org/nscp/downloads 下载最新版的NSClient++

安装的过程和其他windows应用程序的安装过程类似,next即可,选项我们都保持默认

安装过程中需要填写监控端的IP地址和密码,以及把下面的Modules全部勾选上。

我下的是最新的 NSCP-0.4.2.93-x64

 

Nagios 远程监控 (win)
 
 

2. 检查NSClient服务是否启动正常


Nagios 远程监控 (win)
 

3.  进入 services.msc 查看 nsclient++服务是否 为自动启动;


Nagios 远程监控 (win)
 

4. 关于nsclient++的配置文件

写道
默认是安装在C:\Program Files\NSClient++ 目录下

nsclient.ini即为NSClient服务的配置文件,一般我们无需修改,

但是当我们监控端的IP地址改变时,或者密码忘记,即可以在这里修改了。

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
    }


Nagios 远程监控 (win)
 

相关推荐