Nagios安装配置教程(五)window系统监控

Nagios安装配置教程(五)window系统监控



Nagios安装配置教程(五)window系统监控




    nagios监控windows系统主机有三种实现方式:SNMP,NSClient++,NRPE,后面两种方式都需要在windows上安装agent,本文档只介绍使用NSClient++方式来监控Windows


配置window2003 服务器


被监控机Windows主机插件安装和配置

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


安装

Nagios安装配置教程(五)window系统监控


修改NSClient 目录下的nsc.ini 文件

去掉以下内容的注释:

FileLogger.dll

CheckSystem.dll

CheckDisk.dll

NSClientListener.dll

NRPEListener.dll

SysTray.dll

CheckEventLog.dll

CheckHelpers.dll

CheckWMI.dll

修改allowed_hosts ,指定nagios 服务器IP

allowed_hosts=125.221.30.12/24


[nsclient]部分开启NSClinet的默认监听端口12489以及允许访问本机的主机名称,编辑完以后保存退出.

allowed_hosts=125.221.30.12

port=12489



启动服务:

管理工具--服务--NSClientpp 启动这个服务


回到cmd 命令行下,执行netstat -an 查看12489端口是否已经启用

Nagios安装配置教程(五)window系统监控


回到Nagios 服务器上通过以下命令测试,有以下的回显说明服务已可以正常监控到C 验证配置文件是否正确,并重启:




然后到监控主机上去

打开cd /usr/local/nagios/etc/objects

vi host.cfg加入window主机配置


vi services.cfg 加入window系统要监控的配置


define service{

       host_name               111-1af21b3

       service_description     NSClient++ Version

       check_command           check_nt!CLIENTVERSION

         max_check_attempts      5

       normal_check_interval   3

       retry_check_interval    2

       check_period            24x7


       notification_interval   10

       notification_period     24x7


       notification_options    w,u,c,r


       contact_groups          sagroup

}



/usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/object/nagios.cfg (检查配置文件是否正确)

Service nagios restart  (重启nagios 使配置生效)


查看naigios监控页面,发现主机已经被正常添加。




Nagios安装配置教程(五)window系统监控