在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的各种资源。
太极熊猫2百度版 安卓版v1.7.1
下载黎明觉醒应用宝版 安卓版v1.111.1
下载暗影格斗3国际版 (Shadow Fight 3)最新版v1.40.3
下载王者战魂华为版 安卓版v3.6.1
下载放置魔法学院免广告版 v2.9.5
放置魔法学院内置Mod菜单是游戏的破解版本,在该版本中为玩家
万乘之国qq版本 安卓版v1.0.5
万乘之国qq版本是一款极具魅力的策略游戏,玩家们可以通过不同
动物餐厅国际服无限内购版 v12.9
动物餐厅国际服免广告版是游戏的破解版本,在该版本中为玩家去除
欧洲卡车司机 安卓版v3.2
欧洲卡车司机是款模拟经营游戏,这款游戏的画面还是蛮逼真的,给
疯狂大酒店 (Grand Hotel Mania)最新中文版v4.10.0.20
疯狂大酒店(Grand Hotel Mania)是一款好玩的