资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

Nagios配置监控windows客户端

客户端配置:

目前创新互联建站已为1000+的企业提供了网站建设、域名、网页空间、网站托管、服务器租用、企业网站设计、泸溪网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

客户端下载安装NSclient

下载地址:http://nsclient.org/nscp/downloads

安装NSCP-0.4.1.090-Win32 .msi (本人windows系统为32位,如果是64位系统下载64位安装即可)

Nagios配置监控windows客户端

安装完成后运行nscp.exe会自动打开12489端口,用于nagios采集数据

使用netstat -an |more 查看端口是否开启

Nagios配置监控windows客户端

安装完成后如果要修改Nagios服务器地址, 编辑nsclient安装目录下的nsclient.ini,找到allowed hosts = 192.168.0.54 ,更改hosts后面的ip为nagios服务器的ip就可以了。

服务器端配置:

1. 修改nagios.cfg,加载windows.cfg文件

[root@localhost /]# vi /usr/local/nagios/etc/nagios.cfg

cfg_file=/usr/local/nagios/etc/objects/windows.cfg // 取消这一行的注释

2. 修改windows.cfg文件中host主机的address为被监控主机,其他保持默认(使用默认模版)

 ★如果更改host_name注意要将下面service里面引用的host_name都统一更改

 ★如果要增加一台windows监控,在新建一个define host{}进行添加

 ★如果要添加windows监控的服务,新建一个define serice 进行添加

define host{

        use             windows-server  ; Inherit default values from a template

        host_name       zrer-win       ; The name we're giving to this host

        alias           zrer-windows       ; A longer name associated with the host

        address         192.168.0.9     ; IP address of the host  被监控主机ip

        }

define hostgroup{

        hostgroup_name  windows-servers ; The name of the hostgroup

        alias           Windows Servers ; Long name of the group

        }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     NSClient++ Version

        check_command           check_nt!CLIENTVERSION

        }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     Uptime

        check_command           check_nt!UPTIME

        }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     CPU Load

        check_command           check_nt!CPULOAD!-l 5,80,90

        }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     Memory Usage

        check_command           check_nt!MEMUSE!-w 80 -c 90

        }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     C:\ Drive Space

        check_command           check_nt!USEDDISKSPACE!-l c -w 80 -c 90

 }

define service{

        use                     generic-service

        host_name               zrer-win

        service_description     Explorer

        check_command           check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe

        }

3. 重启nagios服务

[root@localhost /]# service nagios restart

打开Nagios web界面查看监控信息

Nagios配置监控windows客户端


文章题目:Nagios配置监控windows客户端
网页地址:http://cdkjz.cn/article/psdoej.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220