将 DescribePatchGroupState 与 CLI 配合使用 - AWS Systems Manager

DescribePatchGroupState 与 CLI 配合使用

以下代码示例演示如何使用 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>__ 和了解补丁合规性状态值

PowerShell
适用于 PowerShell 的工具

示例 1:此示例获取补丁组的高级补丁合规性摘要。

Get-SSMPatchGroupState -PatchGroup "Production"

输出:

Instances : 4 InstancesWithFailedPatches : 1 InstancesWithInstalledOtherPatches : 4 InstancesWithInstalledPatches : 3 InstancesWithMissingPatches : 0 InstancesWithNotApplicablePatches : 0
  • 有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference》中的 DescribePatchGroupState

有关 AWS SDK 开发人员指南和代码示例的完整列表,请参阅 将 Systems Manager 与 AWS SDK 配合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。