1

我正在尝试配置我的 nagios 电子邮件警报,以便它仅针对特定服务向用户发送通知电子邮件。

我想创建一个仅在此服务处于关键状态时才收到通知电子邮件的用户

4

2 回答 2

3

如果我理解您的问题,您只想将单个联系人标记为服务。如果是这样,你可以这样做,而不是添加一个组:

define service{
   ...
   contacts freda,maryb
   ...
}

文档中更深入的内容:Nagios 服务定义 (3.0)

于 2014-01-07T21:22:42.307 回答
2

正如http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#contact

对于您的联系人,请使用此方案根据您的需要更改星形部分。您需要为每个管理员提供一个服务联系人,并将其设置为您要为其获取电子邮件的特定服务中的联系人。(请记住:您可以用逗号分隔多个联系人)

无通知模板:

define contact{
        name                            no-notifications
        host_notification_period        24x7
        service_notification_period     24x7
        host_notification_commands      notifications-disabled
        service_notification_commands   notifications-disabled
        host_notification_options       n
        service_notification_options    n
        host_notifications_enabled      0
        service_notifications_enabled   0
        register                        0
}

关键服务模板:

define contact{
        name                            service-only
        host_notification_period        **TIMEPERIOD**
        service_notification_period     **TIMEPERIOD**
        host_notification_commands      notifications-disabled
        service_notification_commands   notify-service-by-email
        host_notification_options       n
        service_notification_options    c
        host_notifications_enabled      0
        service_notifications_enabled   1
        register                        0
}

您的阻止联系人:

define contact{
        contact_name                    nohost
        use                             no-notifications
}

您的服务联系人:

define contact{
        contact_name                    **Admin Name**
        use                             service-only
}

您的主机配置:

define host{
        use                     host-template-linux
        host_name               Bezeqint2 
        hostgroups              **if you have any**
        address                 **the IP**
        contacts                nohost
}

您的服务配置

define service {
 use generic-service ; defined in templates 
 host_name Bezeqint2 
 service_description VI   
 check_command check_http3! -H usabrm.dainfo.com -u /Anti-Aging/Template1/Pages/LoginPageBRM.aspx -s "txtUserName" 
 contacts **Admin Name**
}
于 2013-12-02T08:37:58.490 回答