1、修改services.cfg
define service{
host_name xx
service_description Memory
check_command check_nrpe!check_mem
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 shyygroup
}
重启nagios
##如果是要监控本机的内存的话:
1、需要在libexec目录内添加check_mem.sh脚本,并在commands.cfg定义
define command{
command_name check_mem
command_line $USER1$/check_mem.sh -w $ARG1$ -c $ARG2$
}
然后才是引用,修改services.cfg
define service{
host_name bb
service_description Current mem
check_command check_mem!180!200
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 shyygroup
}
重启nagios即可
