阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Nagios报警时间间隔的配置

130次阅读
没有评论

共计 2340 个字符,预计需要花费 6 分钟才能阅读完成。

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            24×7

        notification_interval  10

        notification_period    24×7

        notification_options    w,u,c,r

        contact_groups          sagroup

        }

# 监控主机的 web 服务

define service{

        host_name              nagios-server

        service_description    check_tcp 80

        check_period            24×7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24×7

        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            24×7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24×7

        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            24×7

        max_check_attempts      4

        normal_check_interval  3

        retry_check_interval    2

        contact_groups          sagroup

        notification_interval  10

        notification_period    24×7

        notification_options    w,u,c,r

        }

网络监控器 Nagios 全攻略 http://www.linuxidc.com/Linux/2013-07/87067.htm

Nagios 搭建与配置详解 http://www.linuxidc.com/Linux/2013-05/84848.htm

Nginx 环境下构建 Nagios 监控平台 http://www.linuxidc.com/Linux/2011-07/38112.htm

在 RHEL5.3 上配置基本的 Nagios 系统 (使用 Nagios-3.1.2) http://www.linuxidc.com/Linux/2011-07/38129.htm

CentOS 5.5+Nginx+Nagios 监控端和被控端安装配置指南 http://www.linuxidc.com/Linux/2011-09/44018.htm

Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用 http://www.linuxidc.com/Linux/2013-11/93047.htm

Nagios 的详细介绍 :请点这里
Nagios 的下载地址 :请点这里

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2340字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中