Nagios报警时间间隔的配置


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

        }

网络监控器Nagios全攻略

Nagios搭建与配置详解

Nginx环境下构建Nagios监控平台

在RHEL5.3上配置基本的Nagios系统(使用Nagios-3.1.2)

CentOS 5.5+Nginx+Nagios监控端和被控端安装配置指南

Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用

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

本文永久更新链接地址:

相关内容

    暂无相关文章