前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Nagios报警时间间隔的配置

Nagios报警时间间隔的配置

作者头像
星哥玩云
发布2022-07-03 10:42:49
1.5K0
发布2022-07-03 10:42:49
举报
文章被收录于专栏:开源部署开源部署

Nagios报警时间间隔的配置

host_name:必须是主机配置文件hosts.cfg中定义的主机。

check_command:在commands.cfg文件中定义或在nrpe.cfg里面定义的命令;

max_check_attempts: 最大重试次数,一般设置为4次左右;

normal_check_interval 和retry_check_interval检查间隔的单位是分钟。

notification_interval  通知间隔指探测到故障后,每隔多长时间发送一次报警信息,单位是分钟。

notification_options:通知选项跟联系人配置文件相同。

contact_groups:配置文件contactgroup.cfg定义的组名称。

注意:check_command选项后面跟的命令一定要在commands.cfg里有定义;

例子:

vi  /usr/local/nagios/etc/services.cfg

#监控主机是否存活

define service{

        host_name              nagios-server

        service_description    check-host-alive

        check_command          check-host-alive

        max_check_attempts      5

        normal_check_interval  5

        retry_check_interval    2

        check_period            24x7

        notification_interval  10

        notification_period    24x7

        notification_options    w,u,c,r

        contact_groups          sagroup

        }

#监控主机的web服务

define service{

        host_name              nagios-server

        service_description    check_tcp 80

        check_period            24x7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24x7

        notification_options    w,u,c,r

        check_command          check_tcp!80

        }

#监控主机的cpu负载情况

define service{

        host_name              nagios-server

        service_description    cpu load

        check_command          check_nrpe!check_load

        check_period            24x7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24x7

        notification_options    w,u,c,r

        }

#监控主机的进程数

define service{

        host_name              nagios-server

        service_description    total-procs

        check_command          check_nrpe!check_total_procs

        check_period            24x7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24x7

        notification_options    w,u,c,r

        }

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档