• Get started
  • Documentation

Execute AWS EC2 Rescue Tool with Opsgenie actions

Executing AWS EC2Rescue tool via Opsgenie Actions

EC2Rescue is a free AWS troubleshooting tool run on your EC2 instances to resolve operating system-level issues and collect advanced logs and configuration files for further analysis. EC2Rescue tool is used for various troubleshooting cases such as failed health checks or unreachable instances. An EC2 instance may be unreachable due to connectivity issues caused by firewall, RDP, or network interface configurations. Operating system booting issues such as corrupted registry or boot loop may also be the reason of an unhealthy status.

Opsgenie provides actions to trigger EC2Rescue using the AWSSupport-ExecuteEC2Rescue automation document that comes standard in AWS Systems Manager. Within Opsgenie’s action channels, easily configure an Opsgenie action for EC2Rescue tool and execute it whenever an EC2 instance-related alert is received.

Configuration of AWSSupport-ExecuteEC2Rescue action on Opsgenie

To create an Opsgenie action, you need a corresponding automation template for AWS Systems Manager.

  1. Access the Actions tab of your team’s dashboard.

  2. Create an AWS Systems Manager channel with your AWS account ID, AWS Region, and AWS Role.

  3. Create multiple actions using the same channel as long as the account ID, region, and role are compatible with the AWS Systems Manager automation document.

EC2Rescue needs permissions to perform the actions. You can either create a role by using CloudFormation template during action channel creation or add an IAM role on AWS console.

AWS role
Create stack

Due to the security concerns, IAM role must start with prefix opsgenie-automation-actions- to execute action. If you have administrative rights, you can easily run the action with the given policy document below. Otherwise, you may need to contact your account admin to configure the necessary permissions.
For further details, you may refer to this AWS Systems Manager user guide.

Summary

4. Add the related Opsgenie action from the Manage Actions section once the channel is created.

5. Specify the name of the action, select 'AWS Systems Manager' as the type, and choose the action channel created in the previous step.

6. Select AWSSupport-ExecuteEC2Rescue document from the AWS SM Documents section. Search for the document from the drop-down list or type the name of the document in the search box.

Create action

This next section lists the parameters that can be configured for an action. Opsgenie imports the parameters of the corresponding automation document of AWS SM directly. Parameters that are marked as “required” are mandatory for execution. For the EC2Rescue tool, UnreachableInstanceId and EC2RescueInstanceType must be provided, whereas LogDestinationSubnetId, and AssumeRole are optional.

Action parameters

7. You can add the action on CloudWatch Events integration of Opsgenie. Whenever you receive an alert about your EC2 instance via this integration, you can execute EC2Rescue action.

Action

8. A window appears when the action is chosen to execute on the related alert. Click Execute if all the required parameters have predefined values, . Otherwise, provide values for the parameters before executing the action.

EC2 rescue
EC2 execute

9. Navigate to the Activity Log tab to check the result of execution. Opsgenie can only track the execution of action until it is sent to AWS. If the EC2Rescue action is submitted successfully, the AWS execution ID is provided in the related log. Use this ID on your AWS account to check the status of the action.

Activity log

Still need help?

The Atlassian Community is here for you.