Monitoring Applications with Custom CloudWatch Metrics Using AWS Systems Manager

SQL Server Maintenance Plans
July 30, 2019
SQL Server Maintenance Plans

Monitoring Applications with Custom CloudWatch Metrics Using AWS Systems Manager

By default monitoring, we will get only metrics Like CPUUtilization, StatusCheckFailed_System and StatusCheckFailed_Instance, etc.

If we want to monitor Custom metrics (Memused, Logical disk usage, and Autoscaling metrics, etc), we need to install and configure the SSM agent to send data to AWS CloudWatch.

Find below the steps to download, install and configure SSM agents to send custom metrics to AWS Cloudwatch.

Log in to your instance by using Remote Desktop.

Download the latest version of SSM Agent to your instance. You have two options for downloading:

1. PowerShell:

Run the following PowerShell command. This command enables you to download SSM Agent without adjusting Internet Explorer (IE) Enhanced Security settings.

Invoke-WebRequest https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe -OutFile $env:USERPROFILE\\Desktop\\SSMAgent_latest.exe

Download the latest version of SSM Agent to your instance by using the following link. If you want, update this URL with a region-specific URL.

https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/windows_amd64/AmazonSSMAgentSetup.exe

Run the downloaded AmazonSSMAgentSetup.exe file to install SSM Agent.

Start or restart SSM Agent by sending the following command in PowerShell:

Restart-Service AmazonSSMAgent

Update SSM agent on instance.

Go to Systems Manager:

In Run a Command selects AWS-UpdateSSMAgent.

In the Targets section, We can select how many servers we want.

Check platform within AWS Command Line Interface command tab

Click on Run Command.

In the Command document list, choose AWS-ConfigureAWSPackage.

In the Action list, choose Install.

In the Name field, type AmazonCloudWatchAgent.

In the Targets area, choose the instance on which to install the CloudWatch agent.

Check platform within the AWS Command Line Interface command tab and Choose Run at last.

Go to AWS Systems Manager => Parameter Store

Create a Parameter name like this for Windows (AmazonCloudWatch-Windows).

Click on Create parameter,

Name field enters AmazonCloudWatch-Windows.

Select Tier Standard

Select Type String.

In Value Box we need to paste the code for our requirements.

For Windows:

{

“metrics”: {

“append_dimensions”: {

“AutoScalingGroupName”: “${aws:AutoScalingGroupName}”,

“ImageId”: “${aws:ImageId}”,

“InstanceId”: “${aws:InstanceId}”

},

“metrics_collected”: {

“LogicalDisk”: {

“measurement”: [

“% Free Space”

],

“metrics_collection_interval”: 300,

“resources”: [

“*”

]

},

“Memory”: {

“measurement”: [

“% Committed Bytes In Use”

],

“metrics_collection_interval”: 300

},

“statsd\”: {

“metrics_aggregation_interval”: 300,

“metrics_collection_interval”: 300,

“service_address”: “:8125”

}

}

}

}

The above code is used to getting Auto scaling metrics, Logical disk usage, and Memory usage.

In the Command document list, choose AmazonCloudWatch-ManageAgent.

In Command parameters

In the Action list, choose to configure.

In the Optional Configuration Source list, choose ssm.

In the Optional Configuration Location box, type the name of the agent configuration file that you created and saved to Systems Manager Parameter Store, for example- Optional Configuration Location: AmazonCloudWatch-Windows.

In the Targets section, select how many instances we want.

Check platform within the AWS Command Line Interface command tab and Choose Run at last.

This will start sending Cloudwatch metrics such as Memory utilization, Disk usage, autoscaling group metrics and you can see them in cloudwatch metrics.

Leave a Comment

Your email address will not be published. Required fields are marked *

Cloud Computing Insights and Resources

Challenges Faced by Gaming Companies While Adopting Cloud Services

Challenges Faced by Gaming Companies While Adopting Cloud Services 

With the advancement in technology and the progress in cloud infrastructure, the cloud gaming industry is growing at a lightning …

Challenges Faced by Gaming Companies While Adopting Cloud Services  Read More »

5 Trends in Data Analytics Impacting the Cloud World 

5 Trends in Data Analytics Impacting the Cloud World 

What is Cloud data & analytics?  Cloud analytics is the process of analysing data stored in the cloud. It is …

5 Trends in Data Analytics Impacting the Cloud World  Read More »

How Microsoft Azure Cloud Services Different From Competitors

How Microsoft Azure Cloud Services is Different From its Competitors?

Microsoft Azure is one of the eminent cloud computing platforms in the market created by Microsoft for building, deploying, and …

How Microsoft Azure Cloud Services is Different From its Competitors? Read More »