amazon-web-services - Amazon Web Services 无法使用自定义的CloudWatch度量来监视 Windows 实例的可用磁盘空间

  显示原文与译文双语对照的内容
55 3

我创建了一个用户,并向它的添加了以下 inline inline inline inline 。它读取下面的部分:

{
"Version":"2012-10-17",
"Statement": [
 {
"Sid":"AllowAccessToSSM",
"Effect":"Allow",
"Action": [
"cloudwatch:PutMetricData",
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:PutLogEvents"
 ],
"Resource": [
"*"
 ]
 }
 ]
}

然后,通过对. json 文件进行以下更改,成功监视了 可用内存:

...
{
"Id":"PerformanceCounterMemory",
"FullName":"AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName":"Memory",
"CounterName":"Available MBytes",
"InstanceName":"",
"MetricName":"Memory",
"Unit":"Megabytes",
"DimensionName":"InstanceId",
"DimensionValue":"{instance_id}"
 }
},
{
"Id":"CloudWatch",
"FullName":"AWS.EC2.Windows.CloudWatch.CloudWatch.CloudWatchOutputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters":{ 
"AccessKey":"xxxxxxxxxxxxxxxxxxx",
"SecretKey":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Region":"us-east-1",
"NameSpace":"Windows/Demo"
 }
}
"Flows": {
"Flows": 
 [
"PerformanceCounterMemory,CloudWatch"
 ]
 }
...

以这种方式编辑文件后,我在 ec2ConfigSettings中启用了 CloudWatch Integration 。

接下来,我重新开始了英镑 ec2ConfigAmazon Amazon Amazon Amazon服务服务。

成功,我可以在CloudWatch控制台中看到内存度量。

现在,我想监视可用的 磁盘空间

为此,我将这里部分添加到. json 文件中:

 {
"Id":"PerformanceCounterDisk",
"FullName":"AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName":"LogicalDisk",
"CounterName":"% Free Space",
"InstanceName":"C:",
"MetricName":"FreeDisk",
"Unit":"Percent",
"DimensionName":"InstanceId",
"DimensionValue":"{instance_id}"
 }
 },
"Flows": {
"Flows": 
 [
"(PerformanceCounterMemory,PerformanceCounterDisk),CloudWatch"
 ]
 }

完成这项工作后,我重启了 ec2Config Amazon Amazon Amazon Amazon服务,但在我的名字空间中看不到这个指标。仅显示内存,而不显示磁盘空间。

我做了什么错误?

时间:原作者:0个回答

99 0

我只是改变了

"InstanceName":"C:",

"InstanceName":"_Total",

过了一段时间,自由磁盘指标出现了。

原作者:
...