一、Nagios监控主机配置

[root@nagios ~]# cp /usr/local/nagios/etc/nagios.cfg /usr/local/nagios/etc/nagios.cfgbak20130318   //备份nagios.cfg

编辑nagios.cfg配置文件

[root@nagios ~]# vim /usr/local/nagios/etc/nagios.cfg

把下面这行最前面的#号去掉:

39 #cfg_file=/usr/local/nagios/etc/objects/windows.cfg

修改为:#去掉这句话的注释

39 cfg_file=/usr/local/nagios/etc/objects/windows.cfg

编辑windows.cfg配置 文件

[root@nagios ~]# vim /usr/local/nagios/etc/objects/windows.cfg

###############################################################################

# WINDOWS.CFG - SAMPLE CONFIG FILE FOR MONITORING A WINDOWS MACHINE

#

# Last Modified: 06-13-2007

#

# NOTES: This config file assumes that you are using the sample configuration

#        files that get installed with the Nagios quickstart guide.

#

###############################################################################

###############################################################################

###############################################################################

#

# HOST DEFINITIONS

#

###############################################################################

###############################################################################

# Define a host for the Windows machine we'll be monitoring

# Change the host_name, alias, and address to fit your situation

define host{

use             windows-server  ; Inherit default values from a template

host_name       winserver       ; The name we're giving to this host

alias           My Windows Server       ; A longer name associated with the host

address         10.10.10.252      ; IP address of the host

}

###############################################################################

###############################################################################

#

# HOST GROUP DEFINITIONS

#

###############################################################################

###############################################################################

# Define a hostgroup for Windows machines

# All hosts that use the windows-server template will automatically be a member of this group

define hostgroup{

hostgroup_name  windows-servers ; The name of the hostgroup

alias           Windows Servers ; Long name of the group

}

###############################################################################

###############################################################################

#

# SERVICE DEFINITIONS

#

###############################################################################

###############################################################################

# Create a service for monitoring the version of NSCLient++ that is installed

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     NSClient++ Version

check_command           check_nt!CLIENTVERSION

}

# Create a service for monitoring the uptime of the server

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     Uptime

check_command           check_nt!UPTIME

}

# Create a service for monitoring CPU load

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     CPU Load

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

}

# Create a service for monitoring memory usage

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     Memory Usage

check_command           check_nt!MEMUSE!-w 80 -c 90

}

# Create a service for monitoring C:\ disk usage

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     C:\ Drive Space

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

}

define service{

use                     generic-service

host_name               winserver

service_description     D:\ Drive Space

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

}

# Create a service for monitoring the W3SVC service

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     W3SVC

check_command           check_nt!SERVICESTATE!-d SHOWALL -l W3SVC

}

# Create a service for monitoring the Explorer.exe process

# Change the host_name to match the name of the host you defined above

define service{

use                     generic-service

host_name               winserver

service_description     Explorer

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

}

:wq

重启Nagios httpd 服务

[root@nagios ~]# service nagios restart

[root@nagios ~]# service httpd restart

二、Windows被监控主机配置

NSClient++与Nagios服务器通信,主要使用Nagios服务器的check_nt插件。原理图如下

1、下载NSClient++插件

http://nsclient.org/nscp/downloads

http://files.nsclient.org/0.3.x/NSClient%2B%2B-0.3.9-Win32.zip

http://files.nsclient.org/0.3.x/NSClient%2B%2B-0.3.9-x64.zip

2、NSClient++安装插件与配置

解压到C盘:

C:\NSClient++-0.3.9-Win32

打开cmd 切换到C:\>cd C:\NSClient++-0.3.9-Win32

执行NSClient++ /install进行安装

Microsoft Windows [版本 5.2.3790]

(C) 版权所有 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>cd C:\NSClient++-0.3.9-Win32

C:\NSClient++-0.3.9-Win32>NSClient++ /install

Service NSClientpp installed...

l NSClient++.cpp(233) Service installed!

执行nsclient++ SysTray 注意大小写,这一步是安装系统托盘,时间稍微有点长

C:\NSClient++-0.3.9-Win32>NSClient++ SysTray

d NSClient++.cpp(1216) Enabling debug mode...

Invalid command line argument: SysTray

Usage: -version, -about, -install, -uninstall, -start, -stop, -encrypt

Usage: [-noboot] <ModuleName> <commnd> [arguments]

在运行里面输入services.msc打开”服务”

看到下图就说明NSClient服务已经安装上了

双击打开,点”登录”标签,在”允许服务与桌面交互”前打勾

编辑C:\NSClient++-0.3.9-Win32下的nsc.ini文件

[modules]选项

所有模块前面的注释都去掉,除了CheckWMI.dll and RemoteConfiguration.dll这两个;

[Settings]选项

password选项来设置密码,作用是在nagios连接过来时要求提供密码.这一步是可选的,我这里方便起见跳过它,不要密码;

allowed_hosts选项的注释去掉,并且加上运行nagios的监控主机的IP.我改为如下:allowed_hosts=127.0.0.1/32,10.10.10.254 以逗号相隔.这个地方是支持子网的,如果写成192.168.0.0/24则表示该子网内的所有机器都可以访问.如果这个地方是空白则表示所有的主机都可以连接上来.注意是[Settings]部分的,因为[NSClient]部分也有这个选项;

[NSClient]选项

port选项去掉注释,并且它的值是'12489',这是NSClient的默认监听端口;

在CMD中执行NSClient++ /start启动服务,注意所在目录是C:\NSClient++-0.3.9-Win32

C:\NSClient++-0.3.9-Win32>NSClient++ /start

Starting NSClientpp

在cmd里面执行netstat –an可以看到已经开始监听tcp的12489端口了

C:\NSClient++-Win32-0.3.5>netstat -an

TCP    0.0.0.0:12489    0.0.0.0:0     LISTENING

已经正常启动了.注意服务默认设的是”自动”,也就是说是开机自动启动的.

这时在桌面右下角的系统托盘处会出现一个图标

这样被Windows server 2003监控机的配置完成,它就等待nagios发出某个监控请求,然后它执行请求将监控的结果发回到nagios监控主机上。

最后,在服务端监控端执行检测windows server 2003工作站nrpe信息

[root@nagios ~]# /usr/local/nagios/libexec/check_nrpe -H 10.10.10.252

I (0.3.9.329 2011-09-02) seem to be doing fine...

验证通过,测试完成!

3、登录到WEB界面

输入用户名密码:nagiosadmin  123456

http://localhost/nagios

Services

本文转自 yhw85 51CTO博客,原文链接:http://blog.51cto.com/yanghuawu/1156806,如需转载请自行联系原作者

Nagios监控Windows server 2003 系统相关推荐

  1. 服务器2003 系统修复,第十一篇 Windows Server 2003系统修复.pdf

    第十一章 Windows Server 2003系统修复 windows Server 2003提供了各种系 统防护与修复措施统防护与修复措施,,主要包括主要包括:: 磁盘容错系统磁盘容错系统 ((见 ...

  2. 联想旭日410M笔记本,在Windows Server 2003系统下的声卡驱动安装问题

    我的本本型号是联想旭日410M430X4512060Bb,其声卡型号是Conexant HD Audio 5045,装完系统之后,无法安装声卡驱动,给联想的客服打电话,他们也解决不了,说没有针对Win ...

  3. Windows Server 2003系统重装步骤

    Windows Server 2003系统重装步骤 一.重装前的备份 因为装一个干净的系统,必然需要格式化C盘,所以我们要把C盘的数据备份出来.据我的经验,主要包括:桌面的文件.我的文档中的文件.QQ ...

  4. 微软服务器系统还原,怎么进行windows server 2003系统还原

    在Windows Server 2003中安装"系统还原"功能 在Windows Server 2003系统中安装"系统还原"功能时,首先需要准备一张Windo ...

  5. 7代cpu能装虚拟xp系统吗_Windows server 2008 R2和Windows server 2003系统有什么区别?

    作为专业的服务器供应商,遇到了很多客户都会问Windows 2008和2003系统有什么区别?为此,今天和大家分享一下08和03的不同之处 1.2003相对于2008系统版本比较低,导致附带的功能组件 ...

  6. F41G-UT 安装Windows server 2003系统后无法安装显卡驱动的解决办法

    几经折腾,还是把系统换成了windows server 2003,可是安装显卡驱动的时候怎么安装不上,下载了官方的驱动也不行,难道没有2003下面的驱动?不可能,只要XP可以,2003也应该可以的啊, ...

  7. 安装Windows server 2003系统后无法安装显卡驱动的解决办法 (转载)

    转载 几经折腾,还是把系统换成了windows server 2003,可是安装显卡驱动的时候怎么安装不上,下载了官方的驱动也不行,难道没有2003下面的驱动?不可能,只要XP可以,2003也应该可以 ...

  8. 一次windows server 2003系统修复过程

    2013年5月31日星期五 今天应朋友F的邀请,去帮他修复了一台IBM  X3650服务器的win2003系统.我觉得这个问题比较常见,所以想着记录下来,或者有备于自己将来参考. 首先,介绍一下系统出 ...

  9. PE系统下安装windows server 2003

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 前几天被安装了一个任务,重装公司的一台服务器系统.明确要求安装windows server 2003系统. 你懂得啊,现在安装系统基本上不使用光盘了.使 ...

最新文章

  1. 1.10 instanceof关键字
  2. android alert,Android AlertDialog的基本使用
  3. 5G NR Paging寻呼
  4. Hive的安装和配置
  5. Server Develop (三) 多进程实现C/S
  6. 在eclipse中引入jquery.js文件报错的解决方案
  7. Python语法学习第三天--元组
  8. 默认选中select 第一个option
  9. Python词频统计与杨辉三角
  10. PHP将图片剪切成圆形
  11. Spark作业提交流程
  12. Parallel GC
  13. 德鲁克管理思想精髓的17个关键词
  14. 跟着弦哥学人工智能2—HAND-CRAFTED RULES实现的人工智能及其缺陷
  15. 在线全国计算机等级模拟题,全国计算机等级考试模拟试题一级.doc
  16. 蓝桥杯2014省赛——猜年龄(Java)
  17. Linux解决txt文件乱码问题
  18. 用java实现简单绘图
  19. android中如何打开指定卡上的数据连接开关,Android 代码控制手机数据网络的开关(5.0以上)...
  20. 百度地图(HTML5新特性)-全面详解(学习总结---从入门到深化)

热门文章

  1. SQL 编程思想:一切皆关系
  2. 零基础Java学习之成员变量
  3. 团队冲刺第二阶段-2
  4. FreeMarker简介及其语法
  5. LaTeX入门最终集 :LaTeX格式的调整LaTeX中怎么打出数学公式LaTeX的各种上下标
  6. 通过网页查看服务器算法,服务器使用国密(SM2/SM3/SM4)证书,通过浏览器访问
  7. 安卓开发 底部导航图标切换时动画效果_安卓10系统终于来了,流畅度堪比苹果?...
  8. php算出明天的日期,PHP获取昨天、今天及明天日期的方法
  9. 成都郫县php开发学校_成都各区九年制学校、十二年制学校汇总
  10. nginx 负载均衡配置_LINUX系统nginx负载均衡配置