加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 可以覆盖一个Nagios主机组的联系人吗?

发布时间:2020-12-14 03:05:42 所属栏目:Linux 来源:网络整理
导读:我所有 Linux主机的联系人是管理员Nagios contact_group.但是对于这个Linux主机我会喜欢那个名为sandradebug的contact_group也会收到通知. 问题是,当我添加contact_groups sandradebug时,它仍然只是获取通知的管理员而不是sandradebug. 题 如何为这个主机添
我所有 Linux主机的联系人是管理员Nagios contact_group.但是对于这个Linux主机我会喜欢那个名为sandradebug的contact_group也会收到通知.

问题是,当我添加contact_groups sandradebug时,它仍然只是获取通知的管理员而不是sandradebug.

如何为这个主机添加sandradebug,所以通知也会发送到那里?

主机模板

define host {
  name                          linux-host
  use                           generic-host
  check_command                 check-host-alive
  notification_interval         4320
  notification_options          d,u,r
  contact_groups                admins
  register                      0
}

主机定义

define host {
  use                     linux-host
  host_name               example
  alias                   example
  address                 10.10.10.10
  hostgroups              default-linux-services
  contact_groups          sandradebug
}

解决方法

The problem is,that when I add contact_groups sandradebug it is
still only admins that gets the notification and not also
sandradebug.

你重启了Nagios吗?您的上述配置将覆盖模板值,只有sandradebug组才会收到这些警报.

How can I include sandradebug for this one host,so notifications
are also sent there?

Object Inheritance正是您在寻找的:

define host {
    use                     linux-host
    host_name               example
    alias                   example
    address                 10.10.10.10
    hostgroups              default-linux-services
    contact_groups          +sandradebug
}

使用该标志,主机定义使用模板中的数据并将sandradebug添加到警报中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读