您的位置:首页 > 移动开发 > IOS开发

sing NAGIOS to Check the Physical Memory Available on a Windows Host

2017-01-09 14:20 441 查看
By default the CheckNT command checks the virtual memory on a Windows server. So for example, if your server had 4GB of physical memory and a 4GB page file NAGIOS and CheckNT would see 8GB of physical memory. Getting warnings and critical alerts on this memory space is quite often not very helpful. What we really want to know is do we have enough physical memory available on the server so that the server performs as well as it should.

This is where the NRPE plugins are much better as you can get much more granular when monitoring the memory on a Windows host.

To start with we need to create a new command definition. Add this to your commands.cfg (or equivalent):

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


In the above command definition we're using the check_nrpe executable to perform a memory check of the physical memory. The type can be changed to grab just the page file or check the entire virtual memory address space.
Next we need add the physical memory checks by adding a service definition to either your host or service configs (again, depends on how you've structured your NAGIOS configuration).

# Service definition
# Add the service to the service definition
define service {
service_description          Physical Memory
check_command             CheckWindowsPhysicalMem!80!90
host_name               << hostname >>
event_handler_enabled         0
active_checks_enabled         1
passive_checks_enabled        0
notifications_enabled         1
check_freshness            0
freshness_threshold          86400
use                  << service template >>
}

You will need to update the above snippet with the host name you are monitoring and the service template you are using. The !80!90 is the standard warning at 80% usage, critical at 90% usage. These can be varied to suit your host and environment.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Windows physical default