UiPath Documentation
automation-suite
2023.10
false
Linux 版 Automation Suite 安装指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

警示

使用 uipathctl 在 Automation Suite 中配置警示接收人以防止停机。

您必须配置警示接收人,以防止出现可能导致停机的问题。

配置警示​

备注:

您可以在 Automation Suite 安装文件夹.../UiPathAutomationSuite/UiPath_Installer/bin中找到uipathctl 。在开始配置警示之前,请确保启用 kubectl 。

添加电子邮件收件人​

要在安装后添加新的电子邮件配置,请运行以下命令:

./uipathctl config alerts add-email \
  --name test \
  --to "admin@example.com" \
  --from "admin@example.com" \
  --smtp server.mycompany.com \
  --username admin \
  --password somesecret \
  --require-tls \
  --ca-file <path_to_ca_file> \
  --cert-file <path_to_cert_file> \
  --key-file <path_to_key_file> \
  --send-resolved
./uipathctl config alerts add-email \
  --name test \
  --to "admin@example.com" \
  --from "admin@example.com" \
  --smtp server.mycompany.com \
  --username admin \
  --password somesecret \
  --require-tls \
  --ca-file <path_to_ca_file> \
  --cert-file <path_to_cert_file> \
  --key-file <path_to_key_file> \
  --send-resolved

要将电子邮件通知发送给多个收件人,您可以创建多个电子邮件接收人。

标记值示例
name电子邮件配置名称testconfig
to收件人的电子邮件地址admin@example.com
from发件人的电子邮件地址admin@example.com
SMTPSMTP 服务器 URL 或 IP 地址和端口号server.mycompany.com:567
username身份验证用户名admin
password身份验证密码securepassword
require-tls表示已在 SMTP 服务器上启用 TLS 的布尔值标志。不适用
ca-file包含 SMTP 服务器的 CA 证书的文件路径。如果 CA 为私有,则这是可选项。./ca-file.crt
cert-file包含 SMTP 服务器证书的文件路径。如果证书为私有,则这是可选项。./cert-file.crt
key-file包含 SMTP 服务器 CA 证书的文件路径。如果证书是私有,则这是必需项。./key-file.crt
send-resolved解决警示后发送电子邮件的布尔值标志。不适用

删除电子邮件收件人​

要删除电子邮件配置,您必须运行以下命令。确保传递要删除的电子邮件配置的名称。

./uipathctl config alerts remove-email --name test
./uipathctl config alerts remove-email --name test

更新电子邮件收件人​

要更新电子邮件配置,您必须运行以下命令。确保传递要更新的电子邮件配置的名称以及要编辑的其他可选参数。这些参数与添加新电子邮件配置的参数相同。您可以同时传递一个或多个标志。

./uipathctl config alerts update-email --name test [additional_flags]
./uipathctl config alerts update-email --name test [additional_flags]

添加 Webhook 以向外部工具发送警示​

警示管理器配置以 Base64 编码格式存储在密码中。要更新密码,请执行以下步骤:

  1. 在名为 am_config.yaml 的文件中获取现有警示管理器配置。
    kubectl get secret alertmanager-config -n cattle-monitoring-system -o jsonpath="{.data.alertmanager\.yaml}" | base64 --decode > am_config.yaml
    kubectl get secret alertmanager-config -n cattle-monitoring-system -o jsonpath="{.data.alertmanager\.yaml}" | base64 --decode > am_config.yaml
    
  2. 配置 Webhook。有关详细信息,请参阅警示管理器 Webhook 配置。
  3. 将配置编码为 Base64 格式。
    openssl base64 -in am_config.yaml -out am_config_base64.yaml
    openssl base64 -in am_config.yaml -out am_config_base64.yaml
    
  4. 更新密码中的 alertmanager.yaml 属性。将现有的 Base64 编码字符串替换为 am_config_base64.yaml 中的字符串。
  5. 检查警示管理器状态部分中的配置是否已更新。

有关故障排除,请参阅警示管理器和 Prometheus Pod 日志。

测试警示​

要测试警示,请执行以下步骤:

  1. 通过访问 https://monitoring.fqdn/alertmanager 登录警示管理器。
  2. 复制 _oauth2_proxy=<value> Cookie。
  3. 通过 Postman 创建测试警示,如以下示例所示:
    Method: Post
    URL: https://monitoring.fqdn/alertmanager/api/v2/alerts
    Headers: 
    - Content-Type: application/json
    - Cookie: _oauth2_proxy=<value>
    Body: [{"labels":{"alertname":"Acme Alert", "severity":"warning"}}]
    Method: Post
    URL: https://monitoring.fqdn/alertmanager/api/v2/alerts
    Headers: 
    - Content-Type: application/json
    - Cookie: _oauth2_proxy=<value>
    Body: [{"labels":{"alertname":"Acme Alert", "severity":"warning"}}]
    
  4. 现在,您应该可以在警示管理器中看到警示。

检查当前触发的警示​

要查看警示,请使用https://monitoring.fqdn/metrics导航到 Prometheus,然后选择“警示”选项卡。您可以在此处看到 Automation Suite 中配置的所有警示。

  • 要查看活动警示,请使用“触发”复选框筛选警示状态。

  • 选中“显示注释”以显示与警示相对应的消息。

静默警示​

如果警示过于嘈杂,您可以将其静音。为此,请执行以下步骤:

  1. 使用 https://monitoring.fqdn/alertmanager 访问警示管理器。
  2. 找到相关警示,然后选择“静默”。
  3. 填写“创建者”和“注释”详细信息,然后选择“创建” 。警示应该不会再显示在监控仪表板上,也应该不会报告给任何已配置的收件人。

此页面有帮助吗?

连接

需要帮助? 支持(opens in new window)

想要了解详细内容? UiPath Academy(opens in new window)

有问题? UiPath 论坛(opens in new window)

保持更新