DescribePatchGroupState 搭配 AWS SDK或 使用 CLI - AWS Systems Manager

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

DescribePatchGroupState 搭配 AWS SDK或 使用 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

如需開發人員指南和程式碼範例的完整清單 AWS SDK,請參閱 搭配 使用 Systems Manager AWS SDK。本主題也包含有關入門的資訊,以及先前SDK版本的詳細資訊。