简体   繁体   English

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

[英]Configuring nagios email notifications for a specific service

I am trying to configure my nagios email alerts so that it sends notification emails to a user only for a specific service. 我正在尝试配置我的nagios电子邮件警报,以便它仅将针对特定服务的通知电子邮件发送给用户。

I want to create a user that only gets notification emails when this service is at critical 我想创建一个仅在此服务处于紧急状态时才收到通知电子邮件的用户

If I understand your question you just want to tag an individual contact to a service. 如果我理解您的问题,您只想为服务中的单个联系人添加标签。 If this is so you can just do this, in stead of adding a group: 如果是这样,您可以这样做,而不是添加一个组:

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

More in depth in the doc: Nagios Service Definitions (3.0) 在文档中更深入地介绍: Nagios服务定义(3.0)

As by http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#contact http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#contact

For your Contact use this scheme Change the starembraced parts to your desire. 对于您的联系人,请使用此方案将星状部分更改为您想要的。 You need one servicecontact for each Administrator and set it as contact in the specific service you want to get the email for. 您需要为每个管理员提供一个服务联系人,并将其设置为您要获取电子邮件的特定服务中的联系人。 (remember : you can specify more than one contact by seperating comma) (请记住:您可以通过逗号分隔指定多个联系人)

Template for no notifications: 没有通知的模板:

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
}

Template for critical services: 关键服务的模板:

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
}

Your blocking contact: 您的屏蔽联系人:

define contact{
        contact_name                    nohost
        use                             no-notifications
}

Your servicecontact : 您的服务联系方式:

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

Your hostconfiguration: 您的主机配置:

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

Your serviceconfiguration 您的服务配置

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**
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM