2016-06-02

It’s not rare that users having requirements of sending custom metrics to CloudWatch. These metrics can be application based or server based. There are different ways we can send these metrics to CloudWatch like writing a simple PowerShell script and scheduling it in Task Scheduler to run periodically. Alternate way to accomplish this, which I personally find very easy is by making simple changes in EC2ConfigService in your windows instance.

ADVANTAGES:

It is very easy to implement.

There is no need to write scripts which sometimes can be really lengthy.

Task Scheduler is not required which in turn can save memory.

Most Importantly, margin of making error is very less.

Let’s take an example that you want to send Free disk and Memory utilization metrics to CloudWatch.

PREREQUISITES:

EC2Config version should be 2.2.5 or later.

Create IAM user with following permissions.

IMPLEMENTATION:

1. RDP into your windows instance and from the Start menu, click All Programs, and then click EC2ConfigService Settings.

2. Enable CloudWatch Logs Integration and click OK.



3. Go to C:\Program Files\Amazon\Ec2ConfigService\Settings\AWS.EC2.Windows.CloudWatch.json and replace below code in the file.

4. Go to Control Panel\System and Security\Administrative Tools\Settings and restart EC2 Config service.

And It’s done. You can see metrics on CloudWatch in Custom Metric tab. If you are finding any issues in implementation, you can check C:\Program Files\Amazon\Ec2ConfigService\Logs\ Ec2ConfigLog file.

I have used same methodology for some of our clients and personally, I found this simpler in comparison to the other methods.

Feel free to comment if you have any issues in Implementing the same, I will be happy to assist you.

Need professional assistance or consulting services for your custom metrics implementation.? Kindly visit here Please share this blog if you like it.

Show more