huhahapz 发表于 2019-1-15 07:08:49

Nagios(九)—— 监控Windows2003

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


一、配置window2003 服务器
被监控机Windows主机插件安装和配置
下载地址:http://nsclient.org/nscp/downloads


http://pmghong.blog.运维网.com/attachment/201303/002153777.png

修改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=192.168.30.100/24


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


回到cmd 命令行下,执行netstat -an 查看12489端口是否已经启用
http://pmghong.blog.运维网.com/attachment/201303/002222942.png

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


回到Nagios 服务器上通过以下命令测试,有以下的回显说明服务已可以正常监控到windows 主机
# cd /usr/local/nagios/libexec/

# ./check_nrpe -H 192.168.30.120
I (0.3.8.75 2010-05-27) seem to be doing fine...



下面利用Nagiosql 添加windows主机
http://pmghong.blog.运维网.com/attachment/201303/002402704.jpg

设置主机名、地址、选择模板
http://pmghong.blog.运维网.com/attachment/201303/002502798.jpg


然后添加需要的其它服务,这里演示监控C盘空间和PING,监督-服务-添加
http://pmghong.blog.运维网.com/attachment/201303/002557372.jpg


http://pmghong.blog.运维网.com/attachment/201303/002631262.jpg
总体设置状况请按如下图所示操作完成
(1) 监控C盘空间
http://pmghong.blog.运维网.com/attachment/201303/003230729.jpg
(2) 监控Ping
http://pmghong.blog.运维网.com/attachment/201303/002747443.jpg

为当前主机添加上面定义好的服务,(再返回到当前以定义好的主机上面来)选择"服务选项"-选择定义好的需要监控服务,其实在定义服务的时候也可以选择主机的,也可以在主机这里选择相关服务
http://pmghong.blog.运维网.com/attachment/201303/002814506.jpg

记得需要在这里选写入配置才行,然后重启Nagios服务即可
http://pmghong.blog.运维网.com/attachment/201303/002844440.jpg

从上到下执行一次
http://pmghong.blog.运维网.com/attachment/201303/002912743.jpg

重启了nagios服务器之后,过一段时间就可以看到监控的windows主机信息
http://pmghong.blog.运维网.com/attachment/201303/002937576.jpg

看看PNP 绘制图表正不正常
http://pmghong.blog.运维网.com/attachment/201303/003016760.jpg














页: [1]
查看完整版本: Nagios(九)—— 监控Windows2003