为特定服务配置nagios电子邮件通知

时间:2013-11-17 14:56:25

标签: service nagios email-notifications

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

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

2 个答案:

答案 0 :(得分:3)

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

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

更深入的文档:Nagios Service Definitions (3.0)

答案 1 :(得分:2)

通过http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#contact

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

无通知的模板:

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**
}
相关问题