Help AWS Service Actions Beanstalk Actions

Restart the web servers running in your Beanstalk environment

Using Site24x7's IT Automation framework you can create an action profile to restart the application container server running on each Amazon EC2 instance. You can configure to trigger the automation based on the value of metric, relative to a threshold or manually trigger the action from within the Site24x7 console.

Permissions

Please make sure the following partial write level action is present in the policy document assigned to the Site24x7 IAM entity.

  • elasticbeanstalk:RestartAppServer

Constraints

  • The Elastic Beanstalk environment must be monitored by Site24x7

Create an action profile

  • Login to the Site24x7 web console, select Admin > IT Automation Templates
  • Click on Add Automation and select Elastic Beanstalk Action(S) as the type by clicking on the drop down.
  • Provide an appropriate label in the Display Name field for identification purpose
  • Next, select the Beanstalk environment(s) where you want the action to be performed. (If you choose the option $LOCALHOST the operation would be performed on all those environments where the automation profile is mapped)
  • Max Allowed Action Execution Time: The maximum number of seconds Site24x7 has to wait before the request times out. The execution time is set at 15 seconds, by default. You can define an execution time between 1-90 seconds.
  • Send the Automation Result via Email: You can choose to receive an email regarding the automation result by toggling this setting to Yes, and share automation results via an email to your User Alert Group configured in the Notification Profile. This email will contain parameters including the automation name, type of automation, incident reason, destination hosts, and more.
  • Click Save.

Simulate the Automation

Before mapping the action profile, you can test it's functionality by invoking the action manually within the Site24x7 console or by using our REST APIs. Once you've created the profile, navigate back to the IT Automation summary page and click on the  to execute a test run.

Map the Action Profile

To execute the automation, map the action profile to an desired alert event. You can either map the profile to a predefined monitor level event type (Up/Down/trouble) or to an custom attribute level event type (number of instances in degraded state > 5).

Monitor level mapping

Navigate to the Edit monitor page of the monitored Beanstalk environment (“Elastic Beanstalk monitor page" > > Edit) , and map the action profile with any of the following monitor status changes.

  • Execute on Down
  • Execute on Up
  • Execute on Trouble
  • Execute on any Status Change

Attribute level mapping

You can also associate the action profile to an instance related metric like instance degraded, instance severe or to an environment metric like application requests 4xx or application latency. Navigate to the Edit threshold profile page of the monitored Beanstalk environment (Navigate to the Edit Monitor page of the resource > click on the Pencil icon adjacent to the Threshold and Availability field) and map the profile to any desired attribute by clicking on the  "Select Automation to Execute" field.

Usecase

  • A failsafe: Restart your app servers whenever a metric exceeds its configured threshold or when an alert gets triggered.
  • Restore functionality: Detect strange environment behavior (Number of requests generating a 4xx error code is quite high or the time taken to process requests is on the higher side) and automatically invoke an action to restart the web server running on your environment's instances.
Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.

Help AWS Service Actions Beanstalk Actions