cfe 发表于 2013-9-5 09:33:13

如何通过nrpe设置Nagios 3.2 的内存检测

Nagios core3.2 读取内存数据不对

今天老板问我,为啥米nagios上面显示windows的内存和实际内存不符合,经过仔细研究,发现之前的配置文件有一个bug,check_nt对于64位的windows显示的内存其实是windows的实际内存加page file之和。
这个是原先配置的服务

define service{
      use                  generic-service
      hostgroup_name         AU-WIN-HOSTS
      service_description   MemoryUsage
      check_command          check_nt!MEMUSE!-w 90 -c 95
       servicegroups         AU-WIN-SERVICES
       }

他显示的值为 Physical Memory + Page file

如何更正了,很简单,首先在command.cfg中增加一个新的命令定义

# CheckWindowsPhysical Mem command definition
define command {
      command_name CheckWindowsPhysicalMem
      command_line$USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -cCheckMEM -a MaxWarn=$ARG1$% MaxCrit=$ARG2$% ShowAll type=physical

}

然后在对应的windows.cfg中添加一个检测物理内存的服务
define service{
      use                  generic-service
      service_descriptionPhysical Memory
      check_command      CheckWindowsPhysicalMem!94!98
      hostgroup_name            AU-WIN-HOSTS
servicegroups      AU-WIN-SERVICES
      }
检测语法错误
sudo nagios3 -v /etc/nagios3/nagios.cfg
重启
sudo /etc/init.d/nagios3 restart

对于客户端,如果有安装例如TMG之类的防火墙,需要给nrpe服务打开5666端口;如果是32bit的操作系统,需要更新nsclient++的配置文件。(我是直接把64bit的客户端的配置文件nsclient.ini拷贝过去即可)

大湖之子 发表于 2013-9-7 00:48:03

漏洞与补丁齐飞,蓝屏共死机一色!

buser 发表于 2013-9-8 17:33:53

走,MM,咱们化蝶去……

dyok 发表于 2013-9-9 22:51:08

勃起不是万能的,但不能勃起却是万万都不能的!

孤独海岸线 发表于 2013-9-10 09:32:15

好好 学习了 确实不错

阿尔海南粉 发表于 2013-9-12 02:28:29

走自己的路,让别人打车去吧。

roger2001c 发表于 2013-9-13 14:13:42

避孕的效果:不成功,便成“人”。
页: [1]
查看完整版本: 如何通过nrpe设置Nagios 3.2 的内存检测