It is possible that you need to enable memory metrics for your EC2 instances in Amazon but they don’t have access to internet. This is usual when you have created your VPC and part of your servers (for example, the production SQL ones) are located in a VLAN without access to internet.
This could be fixed following these steps:
1. Download AWS SDK for .NET from this link http://aws.amazon.com/developers/getting-started/net/
2. Download Amazon CloudWatch Monitoring Scripts for Microsoft Windows Server package from this link http://aws.amazon.com/code/7932034889155460
3. Add AWS SDK for .NET file (AWSToolsAndSDKForNet_sdk-2.1.0.0-ps-2.1.0.0-tk-1.6.6.0.msi) to AmazonCloudWatchMonitoringWindows.zip package.
4. Upload to the server and unzip AmazonCloudWatchMonitoringWindows.zip file. Use D:\tools\amazon\ folder to unzip the content (or the folder that you prefer, in this article I will suppose we are using this one).
5. Open D:\tools\amazon\AmazonCloudWatchMonitoringWindows folder and double-click on AWSToolsAndSDKForNet_sdk-2.1.0.0-ps-2.1.0.0-tk-1.6.6.0.msi file. This will install AWS SDK for .NET.
6. Edit awscreds.conf file located in D:\tools\amazon\AmazonCloudWatchMonitoringWindows and change the following values for your Access Key ID and Secret Access Key:
AWSAccessKeyId=YourAccessKeyID
AWSSecretKey=YourSecretAccessKey
Save the file.
7. Open a PowerShell console and point to D:\tools\amazon\AmazonCloudWatchMonitoringWindows\ path.
8. Execute the following command to enable the Memory metrics:
mon-put-metrics-mem.ps1 -aws_credential_file D:\tools\amazon\AmazonCloudWatchMonitoringWindows\awscreds.conf -mem_util -mem_used -page_avail -page_used -memory_units Megabytes
9. Set Up Task Scheduler to Send Metrics Reports to Amazon CloudWatch:
1. On your Windows Server instance, click Start, click Administrative Tools, and then click Task Scheduler.
2. On the Action menu, click Create Task.
3. In the Create Task dialog box, on the General tab, in the Name box, type a name for the task, and then select Runwhether user is logged on or not.
4. On the Triggers tab, click New.
5. In the New Trigger dialog box, under Settings, select One time.
6. Under Advanced settings, select Repeattask every and select 5 minutes from the drop-down menu.
7. In the for a duration of drop-down menu, select Indefinitely, and then click OK.
8. On the Actions tab, click New.
9. In the Action drop-down menu, select Starta program.
10. Under Settings, in the Program/script box, type Powershell.exe.
11. In the Add arguments (optional) box, type -command “D:\tools\amazon\AmazonCloudWatchMonitoringWindows\mon-put-metrics-disk.ps1 -mem_util -mem_used -page_avail -page_used -memory_units Megabytes -from_scheduler -logfile D:\tools\amazon\AmazonCloudWatchMonitoringWindows\awsmemmetrics.log”, and then click OK.
12. On the Create Task dialog box, click OK. Enter the user name and password for the account that will run the task, and then click OK.
****************Update on Dec 2017*********************
Some of the links have been removed by AWS. To do the same but in a more “modern” way, you can go to this other article:
Sending Logs, Events, and Performance Counters to Amazon CloudWatch
************************************************************
The Step 2 which you have mentioned as below:-
2. Download Amazon CloudWatch Monitoring Scripts for Microsoft Windows Server package from this link http://aws.amazon.com/code/7932034889155460
But When I opened the below Link. I am getting Error as
https://aws.amazon.com/code/7932034889155460
Error
We were unable to find the page you requested
Can you help me in the same??
LikeLike
Hi Bhushan,
AWS has removed some of the links, I have just added an update at the bottom of the post with a link to a new article and steps to do the same but in a new way.
Thanks!!
LikeLike