

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

# 在适用于 macOS 的 EC2 实例上手动安装和卸载 SSM Agent
<a name="manually-install-ssm-agent-macos"></a>

连接到您的 macOS 实例，然后执行下列步骤来安装 AWS Systems Manager Agent (SSM Agent)。对将使用 Systems Manager 运行命令的每个实例执行这些步骤。此过程中提供的命令也可以通过用户数据作为脚本传递给 Amazon EC2 实例。

**重要**  
强烈建议避免使用生命周期 (EOL) 已终止的操作系统版本。包括 AWS 在内的操作系统供应商通常不为生命周期已终止的版本提供安全补丁或其他更新。继续使用生命周期终止的操作系统会大大增加无法应用升级（包括安全修复）以及其他操作问题的风险。AWS 不会在生命周期已终止的操作系统版本上测试 Systems Manager 功能。

**开始前的准备工作**  
使用 Homebrew 安装 `wget`。

**在 macOS 上安装 SSM Agent**

1. 使用以下命令下载适用于 x86\$164 实例的代理安装程序文件。

   在下面的命令中，将 *region* 替换为您自己的信息。有关支持的 *region* 值的列表，请参阅《Amazon Web Services 一般参考》**中的 [Systems Manager service endpoints](https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) 的 **Region** 列。

   ```
   sudo wget https://s3.region.amazonaws.com/amazon-ssm-region/latest/darwin_amd64/amazon-ssm-agent.pkg
   ```

   对于 Apple silicon 实例，使用以下命令。

   ```
   sudo wget https://s3.region.amazonaws.com/amazon-ssm-region/latest/darwin_arm64/amazon-ssm-agent.pkg
   ```

   见下列。

   ```
   sudo wget https://s3.us-east-2.amazonaws.com/amazon-ssm-us-east-2/latest/darwin_amd64/amazon-ssm-agent.pkg
   ```

1. 使用以下命令运行 SSM Agent 安装程序。

   x86\$164:

   ```
   sudo installer -pkg amazon-ssm-agent.pkg -target /
   ```

1. 检查代理的状态。

   要确定 SSM Agent 代理是否正在运行，请检查位于以下位置的代理日志：`/var/log/amazon/ssm/amazon-ssm-agent.log`。

1. 如果代理日志指示 “amazon-ssm-agent 已停止”，则运行以下命令启动服务。

   ```
   sudo launchctl load -w /Library/LaunchDaemons/com.amazon.aws.ssm.plist && sudo launchctl start com.amazon.aws.ssm
   ```

**重要**  
如果有新工具添加至 Systems Manager 或者对现有工具进行了更新，则将发布 SSM Agent 的更新版本。无法使用代理的最新版本可能会阻止托管式节点使用 Systems Manager 的各项工具和功能。因此，我们建议您自动完成确保机器上的 SSM Agent 为最新的过程。有关更多信息，请参阅 [自动更新到 SSM Agent](ssm-agent-automatic-updates.md)。要获得有关 SSM Agent 更新的通知，请在 GitHub 上订阅 [SSM Agent 发布说明](https://github.com/aws/amazon-ssm-agent/blob/mainline/RELEASENOTES.md)页面。

# 从 macOS 实例卸载 SSM Agent
<a name="uninstall-ssm-agent-macos"></a>

macOS 本地不支持卸载 `PKG` 文件。要从 macOS 的 Amazon Elastic Compute Cloud (Amazon EC2) 实例卸载 AWS Systems Manager Agent (SSM Agent)，可以使用以下位置中的 AWS 托管脚本。

 [https://github.com/aws/amazon-ssm-agent/blob/mainline/Tools/src/update/darwin/uninstall.sh](https://github.com/aws/amazon-ssm-agent/blob/mainline/Tools/src/update/darwin/uninstall.sh) 