Use Cases

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.

730 1406

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.

1237
  1. Add the related Opsgenie action from the Manage Actions section once the channel is created.
  2. Specify the name of the action, select 'AWS Systems Manager' as the type, and choose the action channel created in the previous step.
  3. 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.
875

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 LogDestination, SubnetId, and AssumeRole are optional.

733
  1. 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.
910
  1. 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.
1134 543
  1. 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.
1138