Notifiers 通知服务


Notifiers are services that inform you of alert events. You can configure notifiers to send alert notifications to staff best suited to take corrective action.

通知程序是通知您警报事件的服务。您可以将通知程序配置为向最适合采取纠正措施的员工发送警报通知。

Rancher integrates with a variety of popular IT services, including:

  • Slack: Send alert notifications to your Slack channels.
  • Email: Choose email recipients for alert notifications.
  • PagerDuty: Route notifications to staff by phone, SMS, or personal email.
  • WebHooks: Update a webpage with alert notifications.
  • WeChat: Send alert notifications to your Enterprise WeChat contacts. 企业微信

This section covers the following topics:

Roles-based Access Control for Notifiers 通知的权限管理

Notifiers are configured at the cluster level. This model ensures that only cluster owners need to configure notifiers, leaving project owners to simply configure alerts in the scope of their projects. You don’t need to dispense privileges like SMTP server access or cloud account access.

通知程序(Notifiers)在集群级别配置。 此模型可确保仅集群所有者需要配置通知程序,而项目所有者则可以仅在其项目范围内配置警报。 您无需分配SMTP服务器访问权限或云帐户访问权限。

Adding Notifiers 添加通知

Set up a notifier so that you can begin configuring and sending alerts.

  1. From the Global View, open the cluster that you want to add a notifier.
  2. From the main menu, select Tools > Notifiers. Then click Add Notifier.
  3. Select the service you want to use as your notifier, and then fill out the form.
    SLACK
    EMAIL
    PAGERDUTY
    WEBHOOK
    WECHAT
  4. Available as of v2.3.0 - Select Enable for Send Resolved Alerts if you wish to notify about resolved alerts.
  5. Click Add to complete adding the notifier.

Result: Your notifier is added to Rancher.

Managing Notifiers

After you set up notifiers, you can manage them. From the Global view, open the cluster that you want to manage your notifiers. Select Tools > Notifiers. You can:

  • Edit their settings that you configured during their initial setup.
  • Clone them, to quickly setup slightly different notifiers.
  • Delete them when they’re no longer necessary.

    Example Payload for a Webhook Alert Notifier

    1. {
    2. "receiver": "c-2a3bc:kube-components-alert",
    3. "status": "firing",
    4. "alerts": [
    5. {
    6. "status": "firing",
    7. "labels": {
    8. "alert_name": "Scheduler is unavailable",
    9. "alert_type": "systemService",
    10. "cluster_name": "mycluster (ID: c-2a3bc)",
    11. "component_name": "scheduler",
    12. "group_id": "c-2a3bc:kube-components-alert",
    13. "logs": "Get http://127.0.0.1:10251/healthz: dial tcp 127.0.0.1:10251: connect: connection refused",
    14. "rule_id": "c-2a3bc:kube-components-alert_scheduler-system-service",
    15. "severity": "critical"
    16. },
    17. "annotations": {},
    18. "startsAt": "2020-01-30T19:18:13.321684733Z",
    19. "endsAt": "0001-01-01T00:00:00Z",
    20. "generatorURL": ""
    21. }
    22. ],
    23. "groupLabels": {
    24. "component_name": "scheduler",
    25. "rule_id": "c-2a3bc:kube-components-alert_scheduler-system-service"
    26. },
    27. "commonLabels": {
    28. "alert_name": "Scheduler is unavailable",
    29. "alert_type": "systemService",
    30. "cluster_name": "mycluster (ID: c-2a3bc)"
    31. }
    32. }

    What’s Next?

    After creating a notifier, set up alerts to receive notifications of Rancher system events.

  • Cluster owners can set up alerts at the cluster level.

  • Project owners can set up alerts at the project level.