

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

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

 **描述** 

 `AWSSupport-TroubleshootLinuxMGNDRSAgentLogs`自动化运行手册用于检测在 Linux 服务器中安装 AWS Application Migration Service (AWS MGN) 和 AWS 弹性灾难恢复 (AWS DRS) 复制代理以将源服务器迁移到云端时的常见错误。 AWS 

 **如何工作？** 

 运行手册`AWSSupport-TroubleshootLinuxMGNDRSAgentLogs`采用亚马逊简单存储服务 (Amazon S3) Service 路径，其中 AWS 将 MGN AWS 或 DRS 安装`aws_replication_agent_installer.log`日志作为参数上传。然后，它会执行以下任务：
+ **验证：**检查提供的日志文件是否有效以及其中是否包含至少一个代理安装。
+ **解析：**彻底解析日志文件中最新安装的代理，以查找已知的 AWS MGN 或 AWS DRS 错误。
+ **错误检测和解决：**根据解析，它会检测并列出代理安装过程中出现的任何错误或问题。对于检测到的每个错误，运行手册都提供了帮助解决或缓解问题的详细步骤。

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

**文档类型**

自动化

**所有者**

Amazon

**平台**

Linux

**参数**

**所需的 IAM 权限**

`AutomationAssumeRole` 参数需要执行以下操作才能成功使用运行手册。
+ `s3:GetObject`
+ `s3:ListBucket`

 **说明** 

按照这些步骤对自动化进行配置：

1. [https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs/description](https://console.aws.amazon.com/systems-manager/documents/AWSSupport-TroubleshootLinuxMGNDRSAgentLogs/description)在 Systems Manager 的 “文档” 下导航至。

1. 选择 Execute automation（执行自动化）。

1. 对于输入参数，请输入以下内容：
   + **AutomationAssumeRole （可选）：**

     允许 Systems Manager Automation 代表您执行操作的 AWS AWS Identity and Access Management (IAM) 角色的亚马逊资源名称 (ARN)。如果未指定角色，Systems Manager Automation 将使用启动此运行手册的用户的权限。
   + **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_cn/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_cn/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/)