

• Amazon Systems Manager CloudWatch 控制面板在 2026 年 4 月 30 日之后将不再可用。客户可以像现在一样继续使用 Amazon CloudWatch 控制台来查看、创建和管理其 Amazon CloudWatch 控制面板。有关更多信息，请参阅 [Amazon CloudWatch 控制面板文档](https://docs.amazonaws.cn/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

# 管理重复的 OpsItems
<a name="OpsCenter-working-deduplication"></a>

OpsCenter 可从多个 Amazon Web Services 服务 获得某个源的多个重复 OpsItems。OpsCenter 使用内置逻辑和可配置的重复数据删除字符串的组合来避免创建重复的 OpsItems。在调用[创建OpsItem](https://docs.amazonaws.cn/systems-manager/latest/APIReference/API_CreateOpsItem.html) API 操作时，Amazon Systems Manager 将应用重复数据删除内置逻辑。

Amazon Systems Manager 使用以下重复数据删除逻辑：

1. 创建 OpsItem 时，Systems Manager 会创建和存储基于重复数据删除字符串的哈希值，以及启动 OpsItem 的资源。

1. 当发出另一个创建 OpsItem 的请求时，系统将检查新请求的重复数据删除字符串。

1. 如果此重复数据删除字符串存在匹配的哈希值，则 Systems Manager 将检查现有 OpsItem 的状态。如果现有 OpsItem 的状态为打开或正在进行，则不会创建 OpsItem。如果现有 OpsItem 得到解决，Systems Manager 将创建一个新的 OpsItem。

创建 OpsItem 之后，您*无法* 编辑或更改该 OpsItem 中的重复数据删除字符串。

要管理重复的 OpsItems，可以执行以下操作：
+ 编辑以 OpsCenter 为目标的 Amazon EventBridge 规则的重复数据删除字符串。有关更多信息，请参阅 [在默认 EventBridge 规则中编辑重复数据删除字符串](#OpsCenter-working-deduplication-editing-cwe)。
+ 当您手动创建 OpsItem 时，指定重复数据删除字符串。有关更多信息，请参阅 [使用 Amazon CLI 指定重复数据删除字符串](#OpsCenter-working-deduplication-configuring-manual-cli)。
+ 使用运营洞察查看和解决重复的 OpsItems。您可以使用运行手册来解决重复的 OpsItems。

  为了帮助您解决重复的 OpsItems，并减少由源创建的 OpsItems 的数量，Systems Manager 提供了自动化运行手册。有关信息，请参阅[基于洞察解决重复的 OpsItems](OpsCenter-working-operational-insights.md#OpsCenter-working-operational-insights-resolve)。

## 在默认 EventBridge 规则中编辑重复数据删除字符串
<a name="OpsCenter-working-deduplication-editing-cwe"></a>

按照以下过程为将 OpsCenter 作为目标的 Eventbridge 规则指定重复数据删除字符串。

**为 EventBridge 规则编辑重复数据删除字符串**

1. 登录 Amazon Web Services 管理控制台并打开 Amazon EventBridge 控制台 ([https://console.aws.amazon.com/events/](https://console.amazonaws.cn/events/))。

1. 在导航窗格中，选择**规则**。

1. 选择一个规则，然后选择 **Edit (编辑)**。

1. 转至 **Select target(s)**（选择目标）页面。

1. 在 **Additional settings**（其他设置）部分，选择 **Configure input transformer**（配置输入转换器）。

1. 在 **Template**（模块）对话框中，找到该 `"operationalData": { "/aws/dedup"` JSON 条目以及您要编辑的重复数据删除字符串。

   Eventbridge 规则中的重复数据删除字符串条目使用以下 JSON 格式。

   ```
   "operationalData": { "/aws/dedup": {"type": "SearchableString","value": "{\"dedupString\":\"{{Words the system should use to check for duplicate OpsItems}}\"}"}}
   ```

   见下列。

   ```
   "operationalData": { "/aws/dedup": {"type": "SearchableString","value": "{\"dedupString\":\"SSMOpsCenter-EBS-volume-performance-issue\"}"}}
   ```

1. 编辑这些重复数据删除字符串，然后选择**确认**。

1. 选择**下一步**。

1. 选择**下一步**。

1. 选择**更新规则**。

## 使用 Amazon CLI 指定重复数据删除字符串
<a name="OpsCenter-working-deduplication-configuring-manual-cli"></a>

当您使用 Amazon Systems Manager 控制台或 Amazon CLI 手动创建新的 OpsItem 时，可以指定重复数据删除字符串。有关在控制台中手动创建 OpsItem 时输入重复数据删除字符串的信息，请参阅 [手动创建 OpsItems](OpsCenter-manually-create-OpsItems.md)。如果您使用 Amazon CLI，可为 `OperationalData` 参数输入重复数据删除字符串。参数语法使用 JSON，如下面的示例所示。

```
--operational-data '{"/aws/dedup":{"Value":"{\"dedupString\": \"{{Words the system should use to check for duplicate OpsItems}}\"}","Type":"SearchableString"}}'
```

此处的示例命令指定重复数据删除字符串 `disk full`。

------
#### [ Linux & macOS ]

```
aws ssm create-ops-item \
    --title "EC2 instance disk full" \
    --description "Log clean up may have failed which caused the disk to be full" \
    --priority 1 \
    --source ec2 \
    --operational-data '{"/aws/dedup":{"Value":"{\"dedupString\": \"disk full\"}","Type":"SearchableString"}}' \
    --tags "Key=EC2,Value=ProductionServers" \
    --notifications Arn="arn:aws:sns:us-west-1:12345678:TestUser"
```

------
#### [ Windows ]

```
aws ssm create-ops-item ^
    --title "EC2 instance disk full" ^
    --description "Log clean up may have failed which caused the disk to be full" ^
    --priority 1 ^
    --source EC2 ^
    --operational-data={\"/aws/dedup\":{\"Value\":\"{\\"""dedupString\\""":\\"""disk full\\"""}\",\"Type\":\"SearchableString\"}} ^
    --tags "Key=EC2,Value=ProductionServers" --notifications Arn="arn:aws:sns:us-west-1:12345678:TestUser"
```

------