AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 740360
Accepted
jldugger
jldugger
Asked: 2015-12-03 11:49:26 +0800 CST2015-12-03 11:49:26 +0800 CST 2015-12-03 11:49:26 +0800 CST

如何使负载警报静音?

  • 772

在构成我们的 Nagios 服务器的大量文件中,有服务检查负载:

define service{
        use                             generic-service
        name                            check-load
        hostgroup_name                  nrpe-hosts,!webnodes,!build-cluster
        notification_options            c,r
        service_description             NRPE - Load
        check_command                   check_nrpe!check_load
        contacts                        irc
}

还有两个联系人:

define contact{
        contact_name                    irc
        alias                           ircbot
        host_notification_period        24x7
        service_notification_period     24x7
        host_notification_options       d,u,r,f
        service_notification_options    w,u,c,r,f
        service_notification_commands   notify-by-epager
        host_notification_commands      host-notify-by-epager
        pager                           [email protected]
        }

define contact {
       contact_name                             pagerduty
       alias                                    PagerDuty Pseudo-Contact
       service_notification_period              24x7
       host_notification_period                 24x7
       service_notification_options             u,c,r
       host_notification_options                d,r
       service_notification_commands            notify-service-by-pagerduty
       host_notification_commands               notify-host-by-pagerduty
       pager                                    lol-no
}

编辑:还有,服务继承的事情:

define service{
        name                            generic-service
        check_period                    24x7
        max_check_attempts              3
        normal_check_interval           3
        retry_check_interval            1
        notification_interval           0
        notification_period             24x7
        notification_options            w,c,r
        register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Edit2:还有一个通知命令定义,仅供怀疑者使用;):

# 'notify-by-epager' command definition
define command{
        command_name    notify-by-epager
        command_line    /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
}

Edit3:和主机定义:

define host{
        host_name                       vmprod1
        alias                           vmprod1.example.com
        address                         192.1.1.123
        use                             generic-host
        hostgroups                      nrpe-hosts,vm-hosts,vm-prod,dellraid-hosts
        contact_groups                  example,example-pager
}

这是服务描述“NRPE - 加载”的唯一检查。根据我的阅读,这应该只提醒 irc 联系人,而不是 pagerduty 联系人。然而,我上个月在 PagerDuty 中收到了 100 多个“NRPE - 加载”警报。

我错过了什么?

monitoring
  • 1 1 个回答
  • 187 Views

1 个回答

  • Voted
  1. Best Answer
    jldugger
    2015-12-03T19:19:45+08:002015-12-03T19:19:45+08:00

    为了偿还我的感激之情,我会回答我自己的问题。事实证明,服务隐式继承自 hosts,因此上面的服务检查有一个联系人设置和一个继承的联系人组。

    对服务检查进行简单修复即可:

    define service{
            use                             generic-service
            name                            check-load
            hostgroup_name                  nrpe-hosts,!webnodes,!build-cluster
            notification_options            c,r
            service_description             NRPE - Load
            check_command                   check_nrpe!check_load
            contacts                        irc
            contact_groups
    }
    
    • 1

相关问题

  • 如何监控系统在哪里写/读磁盘?[关闭]

  • 如何监控 SAN 服务器(通过 iSCSI)?

  • 共享点管理?

  • 安全地授予对 SQL 2005 复制监视器的访问权限以创建快照

  • SNMP HOSTMIB.MIB 未加载?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve