

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

# `AWSSupport-TroubleshootLinuxMGNDRSAgentLogs`
<a name="automation-troublshoot-linux-mngdrs-agent-logs"></a>

 **Description** 

 `AWSSupport-TroubleshootLinuxMGNDRSAgentLogs` 自動化 Runbook 用於偵測在 Linux 伺服器上安裝 AWS Application Migration Service (AWS MGN) 和 AWS 彈性災難復原 (AWS DRS) 複寫代理程式時常見的錯誤，以將來源伺服器遷移至 AWS 雲端。

 **如何運作？** 

 Runbook `AWSSupport-TroubleshootLinuxMGNDRSAgentLogs`採用 `aws_replication_agent_installer.log` MGN 或 AWS DRS 安裝日誌上傳為 參數的 AWS Amazon Simple Storage Service (Amazon S3) 路徑。然後，它會執行下列任務：
+ **驗證：**檢查提供的日誌檔案是否有效，以及是否包含至少一個代理程式安裝。
+ **剖析：**徹底剖析日誌檔案中的最新代理程式安裝是否有已知的 AWS MGN 或 AWS DRS 錯誤。
+ **錯誤偵測和解決：**根據剖析，它會偵測並列出代理程式安裝程序期間的任何錯誤或問題。針對每個偵測到的錯誤， Runbook 會提供詳細的步驟，以協助解決或緩解問題。

 [執行此自動化 （主控台）](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs) 

**文件類型**

 自動化

**擁有者**

Amazon

**平台**

Linux

**參數**

**必要的 IAM 許可**

`AutomationAssumeRole` 參數需要下列動作才能成功使用 Runbook。
+ `s3:GetObject`
+ `s3:ListBucket`

 **指示** 

請依照下列步驟設定自動化：

1. 在文件下的 Systems Manager [https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs/description](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs/description)中導覽至 。

1. 選擇 Execute automation (執行自動化)。

1. 針對輸入參數，輸入下列內容：
   + **AutomationAssumeRole （選用）：**

     (IAM) 角色的 Amazon Resource Name AWS AWS Identity and Access Management (ARN)，允許 Systems Manager Automation 代表您執行動作。如果未指定角色，Systems Manager Automation 會使用啟動此 Runbook 之使用者的許可。
   + **BucketName （必要）：**

     儲存複寫代理程式日誌的 Amazon S3 儲存貯體名稱。
   + **S3ObjectKey （必要）：**

     儲存複寫代理程式安裝程式日誌檔案的 Amazon S3 物件金鑰。範例：如果 Amazon S3 URI 為 `s3://bucket_name/path/to/file/aws_replication_agent_installer.log`，則您應該輸入 `path/to/file/aws_replication_agent_installer.log`。
   + **ServiceName （必要）：**

     安裝複寫代理程式的服務名稱。允許的值：`AWS MGN` 或 `AWS DRS`  
![\[Input parameters form for AWS replication agent with fields for role, bucket name, object key, and service.\]](http://docs.aws.amazon.com/zh_tw/systems-manager-automation-runbooks/latest/userguide/images/automation-troublshoot-linux-mngdrs-agent-logs_input_parameters.png)

1. 選取執行。

1. 自動化會啟動。

1. 文件會執行下列步驟：
   + **`ValidateInput`**

     確保複寫代理程式日誌檔案有效，並使用提供的 Amazon S3 儲存貯體名稱和物件路徑存取，然後傳回最新代理程式安裝的位元組數。
   + **`CheckReplicationAgentLogErrors`**

     從最新的安裝位元組開始讀取複寫代理程式日誌檔案，並搜尋已知的 AWS MGN 或 AWS DRS 錯誤。
   + **`MakeFinalOutput`**

      建立先前檢查的輸出，包括找到的錯誤和故障診斷建議的相關資訊。

1. 完成後，請檢閱輸出區段以取得執行的詳細結果：  
![\[Output showing validation step, error detection, and troubleshooting steps for kernel package installation.\]](http://docs.aws.amazon.com/zh_tw/systems-manager-automation-runbooks/latest/userguide/images/automation-troublshoot-linux-mngdrs-agent-logs_outputs.png)

 **參考** 

Systems Manager Automation
+ [執行此自動化 （主控台）](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs/description)
+ [執行自動化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-working-executing.html)
+ [設定自動化](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-setup.html)
+ [支援自動化工作流程登陸頁面](https://aws.amazon.com/premiumsupport/technology/saw/)