Resolve Downtime Issues with AWS System Manager Custom Metrics

March 15, 2022 | Comments(0) |

Consider a situation where you have a downtime issue arising in your machine. Still, the CPU utilization is average, and you cannot think why it is happening. Then custom metrics will come into the picture; you can set some custom metrics like memory utilization metrics to check the downtime is due to high memory utilization or something else.

The first question that strikes in mind is why we need custom metrics when AWS CloudWatch offers a large variety of matrices for your EC2 instances. Sometimes, you need some custom metrics to visualize your instances to know the exact reason for the downtime.

Well, you can achieve custom metrics set up with the help of AWS System Manager, which makes this setup much more effortless and understandable.

AWS System Manager

AWS System Manager (very well known as SSM) is an AWS service that helps to view and control operational data on multiple AWS Resources such as a group of EC2, IoT Devices, On-Prem servers, etc.

It helps you maintain security and compliance by scanning your machines and reporting any violations if found.

Installation of AWS System Manager

By default, AWS SSM is installed on these flavors of EC2 machines-:

  • Amazon Linux
  • Amazon Linux 2
  • Amazon Linux 2 ECS-Optimized Base AMIs
  • SUSE Linux Enterprise Server (SLES) 12 and 15
  • Ubuntu Server 16.04, 18.04, and 20.04

But if your EC2 doesn’t come in the above category, then you can manually install it on your EC2 server, click below on the basis of your OS, and install it:

  1. Amazon Linux
  2. Amazon Linux 2
  3. CentOS
  4. Debian Server
  5. Oracle Linux
  6. Red Hat Enterprise Linux
  7. SUSE Linux Enterprise Server
  8. Ubuntu Server

Setting up Custom Metrics

Step -1:

Create an EC2 role with these policies

  • CloudWatchAgentServerPolicy
  • AmazonSSMManagedInstanceCore
    AWS System Manager

Step -2:

Attach an IAM Role to the instances

  • Go to Instance and click on actions
    AWS System Manager
  • Click on security
    AWS System Manager
  • Click on Modify IAM Role and attach the role that you have created
    AWS System Manager
    AWS System Manager

Step -3:

System Manager

  • Go to system-manager and click on the run command
    AWS System Manager
    AWS System Manager
  • Select the package
    AWS System Manager
  • Keep everything as default and give name as shown, please use the same name as it is case sensitive
    AWS System Manager
  • Choose the instance
    AWS System Manager
  • Disable S3
    AWS System Manager
  • Click on Run
    AWS System Manager
  • It will take a couple of seconds to complete
    AWS System Manager

Step -4:

Parameter Store

  • Click on parameter store to store the configuration from the left navigation
    AWS System Manager
  • Click on create parameter
  • Give the same name as given below, it is mandatory to use AmazonCloudWatch prefix
    AWS System Manager
  • In the values section put json file mentioned below
    AWS System Manager
  • Use the json given below in values field and keep everything default and create the parameter
  • Click here to get the JSON code
  • Repeat for windows if you have windows instance and give name as given below
    AWS System Manager
  • Paste the windows config in values
  • Copy both parameter name in a notepad
  • Go to Run command again in left navigation
  • Go to the 4’rth page and select Amazon-cloudwatch-manage-agent as shown below
    AWS System Manager
  • Paste the name as you have copied, paste windows parameter name as shown below and keep everything default
    AWS System Manager
  • Choose the windows instance as we are setting up for windows one
    AWS System Manager
  • Disable S3 and keep everything as default and click on run
  • Wait for a few seconds it will complete
    AWS System Manager
  • Repeat the process for Linux one
  • Give the Linux parameter name as you stored
    AWS System Manager
  • Choose the instance and disable the s3 and click on Run, Keep all as default
  • Wait for a few minutes it will succeed the installation
    AWS System Manager
  • After 5-10 minutes go to CloudWatch click on metrics and select all metrics
    AWS System Manager
  • There are 2 custom metrics
    AWS System Manager
  • You can well go through each and see your custom metrics
    AWS System Manager

Conclusion

In this world of competition, where there is no room for a lag of your website or serious downtime, you will lose your potential customers who will switch to your competitors. So make your website completely free from such issues by significantly decreasing the downtime, making your application highly available with frequent releases. CloudThat’s team of experts can help you set up a highly available and scalable infrastructure. In addition, we have a special managed service team that will monitor your Infrastructure and resolve issues as soon as possible so that you can focus on your business more than downtime problems.

About CloudThat

Here at CloudThat are the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge on cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.

Feel free to drop a comment or any queries you have regarding AWS services, cloud adoption, consulting, and we will get back to you quickly. To get started, go through our Expert Advisory page and Managed Services Package that is CloudThat’s offerings.


Leave a Reply