Amazon Cloudwatch Monitor the disk space usage configuration for Windows Server2008

Source: Internet
Author: User
Tags json disk usage cloudwatch

After AWS starts Windows Server2008, the Ec2configservice is installed by default.

Here's an introduction to using the Ec2configservice service to create Cloudwatch custom monitoring disk usage.

Ec2configservicesettings

Modify Ec2configservicesettings Configuration

Modify JSON file

Restart Ec2configservice

1. Modify Ec2configservicesettings Configuration

After starting C:\Program files\amazon\ec2configservice\ec2configservicesettings.exe, tick "enable cloudwatch Logs integratin.".

2. Modify JSON file

Then modify the AWS.EC2.Windows.CloudWatch.json file under the C:\Program files\amazon\ec2configservice\settings folder.

Only the disk usage of Windows Server is monitored here.

{
"Engineconfiguration": {
"PollInterval": "00:05:00",
"Components": [
{
"Id": "PerformanceCounter",
"FullName": "AWS." EC2. Windows.cloudwatch.performancecountercomponent.performancecounterinputcomponent,aws. EC2. Windows.cloudwatch ",
"Parameters": {
"CategoryName": "LogicalDisk",
"CounterName": "% free spaces",
"InstanceName": "C:",
"Metricname": "Diskfree",
"Unit": "Percent",
"DimensionName": "Instanceid",
' Dimensionvalue ': ' {instance_id} '
}
},
{
"Id": "Cloudwatch",
"FullName": "AWS." EC2. Windows.cloudwatch.cloudwatch.cloudwatchoutputcomponent,aws. EC2. Windows.cloudwatch ",
"Parameters":
{
"AccessKey": "[Fill AccessKey]",
"Secretkey": "[Fill Secretkey]",
"Region": "[Fill Region]",
"NameSpace": "Windows/default"
}
}
],
"Flows": {
"Flows":
[
"Performancecounter,cloudwatch"
]
}
}
}
3. Restart Ec2configservice

>net Stop Ec2config
The Ec2config service is stopping.
The Ec2config service was stopped successfully.

>net Start Ec2config
The Ec2config service is starting.
The Ec2config service was started successfully.
In Cloudwatch, confirm whether to obtain the monitoring value

Click on the "windows/default" below "metrics".

Confirm the value of the diskfree.

Conclusion

There is no mention of IAM users and roles (at least to the user additional cloudwatchfullaccess policy), give EC2 the method of granting permissions generally have 2 kinds.

Create a role before starting the EC2 and assign the created role to the EC2 when you start the EC2
Create a user with the specified policy and use the accesskey and secretkey of that user to access the various resources in AWS.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.