1

我想将 Nagios 配置为在 HostA 或 HostA 上的任何服务出现问题时向 UserA 发送警报。第一部分 - 当 HostA 出现问题时 - 很简单,但是当给定主机(或主机组)上的任何服务出现问题时,我看不到如何向给定用户发送警报。要清楚:

如果 HostA 上的任何服务有问题,请通知 UserA
如果 HostB 上的任何服务有问题,请通知 UserB

任何指示或想法?

4

1 回答 1

0

在服务定义中,您需要设置contact_groups(并在其他地方定义组)。这是一个例子:

define service{
    name                            A-service ; The 'name' of this service template
    active_checks_enabled           1       ; Active service checks are enabled
    passive_checks_enabled          1       ; Passive service checks are enabled/accepted
    parallelize_check               1       ; Active service checks should be parallelized
    obsess_over_service             1       ; We should obsess over this service (if necessary)
    check_freshness                 0       ; Default is to NOT check service 'freshness'
    notifications_enabled           1       ; Service notifications are enabled
    event_handler_enabled           1       ; Service event handler is enabled
    flap_detection_enabled          1       ; Flap detection is enabled
    failure_prediction_enabled      1       ; Failure prediction is enabled
    process_perf_data               1       ; Process performance data
    retain_status_information       1       ; Retain status information across program restarts
    retain_nonstatus_information    1       ; Retain non-status information across program restarts
    notification_interval           0       ; Only send notifications on status$
    is_volatile                     0
    check_period                    24x7
    normal_check_interval           5
    retry_check_interval            1
    max_check_attempts              4
    notification_period             24x7
    notification_options            w,u,c,r
    contact_groups                  A_only  ; >>>Here's the magic you need<<<
    register                        0       ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SE$
}
# for contact config file
define contactgroup{
    contactgroup_name       A_only
    alias                   APeople
    members                 APerson1, APerson2
}

对于 B 组,将 A_only 更改为 B_only 并创建一个新的联系人组。

于 2012-05-04T01:40:32.943 回答