For those wishing to use native AWS services like CloudWatch for your Windows OS logging and/or monitoring, you have to explicitly define what you want to send to CloudWatch in “%programfiles%AmazonEc2ConfigServiceSettings AWS.EC2.Windows.CloudWatch.json”. Focusing on performance metrics, similar to what you’d get out of the box with most monitoring solutions, there is one example given:
{
"Id": "PerformanceCounter",
"FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName": "Memory",
"CounterName": "Available MBytes",
"InstanceName": "",
"MetricName": "Memory",
"Unit": "Megabytes",
"DimensionName": "",
"DimensionValue": ""
}
},
This monitors available RAM. Below are additional performance counter examples. Be sure to use a unique ID for each check you add, and add these IDs to the Flows section at the bottom of the json file. Save the config and restart the EC2Config Service to take effect.
Logical CPU Usage
You should use the built-in CloudWatch CPUUtilization metric for this.
Amount Free Space C:
{
"Id": "PerformanceCounterDisk",
"FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName": "LogicalDisk",
"CounterName": "Free Megabytes",
"InstanceName": "C:",
"MetricName": "FreeDisk",
"Unit": "Megabytes",
"DimensionName": "",
"DimensionValue": ""
}
},
Paging File Usage:
{
"Id": "PerformanceCounterPaging",
"FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName": "Paging File",
"CounterName": "Paging Usage",
"InstanceName": "_Total",
"MetricName": "Paging",
"Unit": "Percent",
"DimensionName": "",
"DimensionValue": ""
}
},
If you were using all of these, your Flows section might look like:
"Flows": {
"Flows":
[
"(ApplicationEventLog,SystemEventLog),CloudWatchLogs",
"(PerformanceCounter,PerformanceCounterCPU,PerformanceCounterDisk,PerformanceCounterPaging),CloudWatch"
]
}
See also:
Reading:
Social