

• 2026 年 4 月 30 日之後將不再提供 AWS Systems Manager CloudWatch Dashboard。客戶可以繼續使用 Amazon CloudWatch 主控台來檢視、建立和管理其 Amazon CloudWatch 儀表板，就像現在一樣。如需詳細資訊，請參閱 [Amazon CloudWatch Dashboard 文件](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 將自訂庫存中繼資料指派給受管節點
<a name="inventory-custom-metadata"></a>

下列程序會逐步引導您使用 AWS Systems Manager [PutInventory](https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_PutInventory.html) API 操作，將自訂庫存中繼資料指派給受管節點。此範例會將機架位置資訊指派給節點。如需自訂清查的詳細資訊，請參閱 [使用自訂庫存](inventory-custom.md)。

**指派自訂庫存中繼資料給節點**

1. 如果您尚未安裝和設定 AWS Command Line Interface (AWS CLI)。

   如需相關資訊，請參閱[安裝或更新最新版本的 AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)。

1. 請執行下列命令，將機架位置資訊指派給節點。

   **Linux**

   ```
   aws ssm put-inventory --instance-id "{{ID}}" --items '[{"CaptureTime": "2016-08-22T10:01:01Z", "TypeName": "Custom:RackInfo", "Content":[{"RackLocation": "Bay B/Row C/Rack D/Shelf E"}], "SchemaVersion": "1.0"}]'
   ```

   **Windows**

   ```
   aws ssm put-inventory --instance-id "{{ID}}" --items "TypeName=Custom:RackInfo,SchemaVersion=1.0,CaptureTime=2021-05-22T10:01:01Z,Content=[{RackLocation='Bay B/Row C/Rack D/Shelf F'}]"
   ```

1. 執行下列命令，即可檢視此節點的自訂庫存項目。

   ```
   aws ssm list-inventory-entries --instance-id {{ID}} --type-name "Custom:RackInfo"
   ```

   系統會回應相關資訊，如下所示。

   ```
   {
       "InstanceId": "{{ID}}", 
       "TypeName": "Custom:RackInfo", 
       "Entries": [
           {
               "RackLocation": "Bay B/Row C/Rack D/Shelf E"
           }
       ], 
       "SchemaVersion": "1.0", 
       "CaptureTime": "2016-08-22T10:01:01Z"
   }
   ```

1. 執行以下命令來檢視自訂清查結構描述。

   ```
   aws ssm get-inventory-schema --type-name Custom:RackInfo
   ```

   系統會回應相關資訊，如下所示。

   ```
   {
       "Schemas": [
           {
               "TypeName": "Custom:RackInfo",
               "Version": "1.0",
               "Attributes": [
                   {
                       "DataType": "STRING",
                       "Name": "RackLocation"
                   }
               ]
           }
       ]
   }
   ```