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
- Adding notifiers rancher添加通知服务
- Managing notifiers 管理通知配置
- Example payload for a webhook alert notifier 配置webhook通知器的样例
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.
- From the Global View, open the cluster that you want to add a notifier.
- From the main menu, select Tools > Notifiers. Then click Add Notifier.
- Select the service you want to use as your notifier, and then fill out the form.
SLACK
EMAIL
PAGERDUTY
WEBHOOK
WECHAT - Available as of v2.3.0 - Select Enable for Send Resolved Alerts if you wish to notify about resolved alerts.
- 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
{
"receiver": "c-2a3bc:kube-components-alert",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"alert_name": "Scheduler is unavailable",
"alert_type": "systemService",
"cluster_name": "mycluster (ID: c-2a3bc)",
"component_name": "scheduler",
"group_id": "c-2a3bc:kube-components-alert",
"logs": "Get http://127.0.0.1:10251/healthz: dial tcp 127.0.0.1:10251: connect: connection refused",
"rule_id": "c-2a3bc:kube-components-alert_scheduler-system-service",
"severity": "critical"
},
"annotations": {},
"startsAt": "2020-01-30T19:18:13.321684733Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": ""
}
],
"groupLabels": {
"component_name": "scheduler",
"rule_id": "c-2a3bc:kube-components-alert_scheduler-system-service"
},
"commonLabels": {
"alert_name": "Scheduler is unavailable",
"alert_type": "systemService",
"cluster_name": "mycluster (ID: c-2a3bc)"
}
}
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.