在AWS启动Windows Server2008之后,默认以安装了EC2ConfigService。
在这里介绍一下,使用EC2ConfigService服务创建CloudWatch自定义监视磁盘使用率。
EC2ConfigServiceSettings
修改EC2ConfigServiceSettings配置
修改JSON文件
重启EC2ConfigService
1. 修改EC2ConfigServiceSettings配置
启动C:Program FilesAmazonEc2ConfigServiceEc2ConfigServiceSettings.exe之后,勾选「Enable CloudWatch Logs integratin.」。
2. 修改JSON文件
接着修改C:Program FilesAmazonEc2ConfigServiceSettings文件夹下面的AWS.EC2.Windows.CloudWatch.json文件。
在这里仅监视Windows Server的磁盘使用率。
{
"EngineConfiguration": {
"PollInterval": "00:05:00",
"Components": [
{
"Id": "PerformanceCounter",
"FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
"Parameters": {
"CategoryName": "LogicalDisk",
"CounterName": "% Free Space",
"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": "[填写AccessKey]",
"SecretKey": "[填写SecretKey]",
"Region": "[填写Region]",
"NameSpace": "Windows/Default"
}
}
],
"Flows": {
"Flows":
[
"PerformanceCounter,CloudWatch"
]
}
}
}
3. 重启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.
在CloudWatch,确认是否获取到监控值
点击「Metrics」下面的「Windows/Default」。
确认DiskFree的值。
结语
在这里没有提IAM用户及角色(至少给用户附加CloudWatchFullAccess策略),给EC2赋予权限的方法一般有2种。
启动EC2之前创建角色,并在启动EC2时把创建好的角色赋予到EC2
创建拥有指定策略的用户,并使用该用户的AccessKey和SecretKey访问AWS的各种资源。
茶杯头甜蜜终章dlc 官方手机版v1.0.0.3
下载火柴人传说暗影格斗内置菜单 最新版v3.0.1
下载荒野乱斗测试服 安卓版v61.10.3
下载荒野乱斗彩虹服 安卓版v61.10.3
下载寒霜启示录 安卓版v1.25.10
寒霜启示录是一款生存模拟游戏,不少玩家可能对于末日都有着自己
末日城堡免广告版 安卓最新版v0.7.1
末日城堡免广告版是一款非常好玩的模拟经营类游戏,内部可以不看
甜蜜人生模拟器 最新版v1.4.5
甜蜜人生模拟器是一款非常好玩的模拟恋爱手游,玩家在这里能够对
武器锻造师内置功能菜单 v10.4
武器锻造师内置菜单版是游戏的破解版本,在该版本中为玩家提供了
开放空间overfield 安卓版v1.0.5
开放空间Overfield是一款箱庭养成经营手游,让你在广阔