

• AWS Systems Manager CloudWatch ダッシュボードは、2026 年 4 月 30 日以降は利用できなくなります。お客様は、これまでと同様に Amazon CloudWatch コンソールを使用して、Amazon CloudWatch ダッシュボードの表示、作成、管理を継続できます。詳細については、「[Amazon CloudWatch ダッシュボードのドキュメント](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)」を参照してください。

# CLI で `DescribePatchGroupState` を使用する
<a name="example_ssm_DescribePatchGroupState_section"></a>

次のサンプルコードは、`DescribePatchGroupState` を使用する方法を説明しています。

------
#### [ CLI ]

**AWS CLI**  
**パッチグループの状態を取得するには**  
次の `describe-patch-group-state` の例では、パッチグループのパッチコンプライアンスの概要を取得します。  

```
aws ssm describe-patch-group-state \
    --patch-group {{"Production"}}
```
出力:  

```
{
    "Instances": 21,
    "InstancesWithCriticalNonCompliantPatches": 1,
    "InstancesWithFailedPatches": 2,
    "InstancesWithInstalledOtherPatches": 3,
    "InstancesWithInstalledPatches": 21,
    "InstancesWithInstalledPendingRebootPatches": 2,
    "InstancesWithInstalledRejectedPatches": 1,
    "InstancesWithMissingPatches": 3,
    "InstancesWithNotApplicablePatches": 4,
    "InstancesWithOtherNonCompliantPatches": 1,
    "InstancesWithSecurityNonCompliantPatches": 1,
    "InstancesWithUnreportedNotApplicablePatches": 2
}
```
詳細については、「*AWS Systems Manager ユーザーガイド*」の「パッチグループ」<https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-patch-patchgroups.html> および「[パッチコンプライアンス状態の値について](https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance-states.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DescribePatchGroupState](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ssm/describe-patch-group-state.html)」を参照してください。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**例 1: この例では、パッチグループのパッチコンプライアンスの概要を取得します。**  

```
Get-SSMPatchGroupState -PatchGroup "Production"
```
**出力:**  

```
Instances                          : 4
InstancesWithFailedPatches         : 1
InstancesWithInstalledOtherPatches : 4
InstancesWithInstalledPatches      : 3
InstancesWithMissingPatches        : 0
InstancesWithNotApplicablePatches  : 0
```
+  API の詳細については、*AWS Tools for PowerShell コマンドレットリファレンス (V4)* の「[DescribePatchGroupState](https://docs.aws.amazon.com/powershell/v4/reference)」を参照してください。

**Tools for PowerShell V5**  
**例 1: この例では、パッチグループのパッチコンプライアンスの概要を取得します。**  

```
Get-SSMPatchGroupState -PatchGroup "Production"
```
**出力:**  

```
Instances                          : 4
InstancesWithFailedPatches         : 1
InstancesWithInstalledOtherPatches : 4
InstancesWithInstalledPatches      : 3
InstancesWithMissingPatches        : 0
InstancesWithNotApplicablePatches  : 0
```
+  API の詳細については、AWS Tools for PowerShell Cmdlet リファレンス (V5) の「[DescribePatchGroupState](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。

------

AWS SDK デベロッパーガイドとコード例の詳細なリストについては、[このサービスを AWS SDK で使用する](sdk-general-information-section.md) を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。