手机版
你好,游客 登录 注册
背景:
阅读新闻

Nagios监控内存和某个端口是否开启

[日期:2012-12-21] 来源:Linux社区  作者:inbank2012 [字体:大 中 小]
【服务端】--监控远程主机内存
 
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即可linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款