

• 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)。

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

# 在 macOS 專用 EC2 執行個體使用 SSM Agent
<a name="ssm-agent-macos"></a>

AWS Systems Manager (SSM Agent) 會處理 Systems Manager 請求並設定您的機器，如請求中所指定。請使用下列程序為 macOS 安裝、設定或解除安裝 SSM Agent。

**注意**  
SSM Agent 預設會預先安裝在 macOS 的 Amazon Machine Images (AMIs) 上。您不需要在 macOS 的 Amazon Elastic Compute Cloud (Amazon EC2) 執行個體上安裝 SSM Agent，除非您已將其解除安裝。

可在 [https://github.com/aws/amazon-ssm-agent](https://github.com/aws/amazon-ssm-agent) 上使用 SSM Agent 的原始碼，以便調整代理程式來符合需求。我們建議您為想要進行的變更提交[提取請求](https://github.com/aws/amazon-ssm-agent/blob/mainline/CONTRIBUTING.md)。但是， AWS 不支援執行修改過的軟體複本。

**注意**  
若要檢視不同版本的 SSM Agent 的詳細資訊，請參閱[版本備註](https://github.com/aws/amazon-ssm-agent/blob/mainline/RELEASENOTES.md)。

在 macOS 作業系統上手動安裝 SSM Agent 之前，請先檢閱下列資訊。
+ 依預設，SSM Agent 會安裝在 Systems Manager 支援的 EC2 執行個體和 Amazon Machine Images 上。如需詳細資訊，請參閱 [macOS 的支援作業系統清單](operating-systems-and-machine-types.md#prereqs-os-mac)。

  不需要在 macOS EC2 執行個體上手動安裝 SSM Agent，除非已解除安裝。
+ 並非所有 都macOS支援 的 EC2 執行個體 AWS 區域。如需支援 macOS 的 x86 型和 M1 EC2 執行個體的區域清單，請參閱《Amazon EC2 常見問答集》中的 [macOS 工作負載](https://aws.amazon.com/ec2/faqs/#macos_workloads)。
+ 當 Systems Manager 新增了新工具，或現有工具有更新時，會發行 SSM Agent 的更新版本。若未使用最新版本的 Agent，您的受管節點可能會無法使用 Systems Manager 中的各種工具及功能。因此，我們建議您讓機器的 SSM Agent 自動保持最新狀態。如需相關資訊，請參閱[自動化 SSM Agent 更新](ssm-agent-automatic-updates.md)。請訂閱 GitHub 上的 [SSM Agent 版本備註](https://github.com/aws/amazon-ssm-agent/blob/mainline/RELEASENOTES.md)頁面，以便接收有關 SSM Agent 更新的通知。

**Topics**
+ [在 macOS EC2 執行個體上手動安裝和解除安裝 SSM Agent](manually-install-ssm-agent-macos.md)

# 在 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 通常不會為已達到 EOL 的版本提供安全修補程式或其他更新。繼續使用 EOL 系統可大幅提高無法套用升級的風險，包括安全性修正和其他操作問題。 AWS 不會在已達到 EOL 的作業系統版本上測試 Systems Manager 功能。

**開始之前**  
使用 Homebrew 安裝 `wget`。

**在 macOS 上安裝 SSM Agent**

1. 使用以下命令來下載 x86\$164 執行個體的代理程式安裝程式檔案。

   在下列命令中，用您自己的資訊取代*區域*。如需支援的 *region* 值的清單，請參閱《Amazon Web Services 一般參考》**中 [Systems Manager 服務端點](https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_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 is stopped." (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 的更新版本。若未使用最新版本的 Agent，您的受管節點可能會無法使用 Systems Manager 中的各種工具及功能。因此，我們建議您讓機器的 SSM Agent 自動保持最新狀態。如需相關資訊，請參閱[自動化 SSM Agent 更新](ssm-agent-automatic-updates.md)。請訂閱 GitHub 上的 [SSM Agent 版本備註](https://github.com/aws/amazon-ssm-agent/blob/mainline/RELEASENOTES.md)頁面，以便接收有關 SSM Agent 更新的通知。

# 從 macOS 執行個體解除安裝 SSM Agent
<a name="uninstall-ssm-agent-macos"></a>

macOS 本就不支援解除安裝 `PKG` 檔案。若要從 的 Amazon Elastic Compute Cloud (Amazon EC2SSM Agent) 執行個體解除安裝 AWS Systems Manager Agent ()macOS，您可以從下列位置使用 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) 