Custom Cloud watch metrics using AWS Systems Manager

Custom Cloud watch metrics using AWS Systems Manager

by admin
Want create site? Find Free WordPress Themes and plugins.

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.

PowerShell - Custom Cloud watch metrics using AWS Systems Manager

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

2. Download link:

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.

run a command - Custom Cloud watch metrics using AWS Systems Manager

 

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

target - Custom Cloud watch metrics using AWS Systems Manager

Check platform within AWS Command Line Interface command tab

Aws command line interface command - Custom Cloud watch metrics using AWS Systems Manager

Click on Run Command.

In the Command document list, choose AWS-ConfigureAWSPackage.

run command 2 - Custom Cloud watch metrics using AWS Systems Manager

In the Action list, choose Install.

In the Name field, type AmazonCloudWatchAgent.

Command Parameter - Custom Cloud watch metrics using AWS Systems Manager

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

target2 - Custom Cloud watch metrics using AWS Systems Manager

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

AWS command line interface command 2 - Custom Cloud watch metrics using AWS Systems Manager

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.

parameter details - Custom Cloud watch metrics using AWS Systems Manager

Select Tier Standard

Tier - Custom Cloud watch metrics using AWS Systems Manager

Select Type String.

type string - Custom Cloud watch metrics using AWS Systems Manager

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

value - Custom Cloud watch metrics using AWS Systems Manager

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.

command document - Custom Cloud watch metrics using AWS Systems Manager

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.

Command Parameter2 - Custom Cloud watch metrics using AWS Systems Manager

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

target 3 - Custom Cloud watch metrics using AWS Systems Manager

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

Aws command line interface command 3 - Custom Cloud watch metrics using AWS Systems Manager

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

 

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

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