$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
================================================================
= Welcome to the Amazon CloudWatch Agent Configuration Manager =
= =
= CloudWatch Agent allows you to collect metrics and logs from =
= your host and send them to CloudWatch. Additional CloudWatch =
= charges may apply. =
================================================================
# 사용하고 있는 운영체제는 무엇입니까?
On which OS are you planning to use the agent?
1. linux
2. windows
3. darwin
default choice: [1]:
1
# EC2 인스턴스 환경인지? 아니면 온프레미스 환경인지?
Trying to fetch the default region based on ec2 metadata...
I! imds retry client will retry 1 timesAre you using EC2 or On-Premises hosts?
1. EC2
2. On-Premises
default choice: [1]:
1
# 리눅스에서 어떤 user가 Cloudwatch Agent를 사용할 건지?
Which user are you planning to run the agent?
1. cwagent
2. root
3. others
default choice: [1]:
2
# StatsD 데몬(애플리케이션 지표를 수집)을 사용할 건지?
Do you want to turn on StatsD daemon?
1. yes
2. no
default choice: [1]:
2
# CollectD라는 시스템 메트릭 모니터링 도구를 사용할 건지?
Do you want to monitor metrics from CollectD? WARNING: CollectD must be installed or the Agent will fail to start
1. yes
2. no
default choice: [1]:
2
# 컴퓨터(host)의 메트릭(CPU, 메모리 등)을 모니터링 할 건지?
Do you want to monitor any host metrics? e.g. CPU, memory, etc.
1. yes
2. no
default choice: [1]:
1
# 코어별로 CPU 메트릭을 모니터링 할 건지?
Do you want to monitor cpu metrics per core?
1. yes
2. no
default choice: [1]:
1
# 모든 메트릭에 EC2 Dimension(이미지 ID, 인스턴스 ID, 인스턴스 타입, 오토스케일링 그룹 이름)의 정보를 추가해서 수집할 건지?
Do you want to add ec2 dimensions (ImageId, InstanceId, InstanceType, AutoScalingGroupName) into all of your metrics if the info is available?
1. yes
2. no
default choice: [1]:
1
# EC2 Dimension(InstanceId)를 기준으로 집계를 할 건지?
Do you want to aggregate ec2 dimensions (InstanceId)?
1. yes
2. no
default choice: [1]:
1
# 메트릭을 몇 초 간격으로 수집을 할 건지?
Would you like to collect your metrics at high resolution (sub-minute resolution)? This enables sub-minute resolution for all metrics, but you can customize for specific metrics in the output json file.
1. 1s
2. 10s
3. 30s
4. 60s
default choice: [4]:
4
# 기본 메트릭 구성을 어떻게 설정할 건지?
# Basic : 메모리 사용량(mem_used_percent), 디스크 사용량(disk_used_percent))
Which default metrics config do you want?
1. Basic
2. Standard
3. Advanced
4. None
default choice: [1]:
1
Current config as follows:
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root"
},
"metrics": {
"aggregation_dimensions": [
[
"InstanceId"
]
],
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}"
},
"metrics_collected": {
"disk": {
"measurement": [
"used_percent"
],
"metrics_collection_interval": 60,
"resources": [
"*"
]
},
"mem": {
"measurement": [
"mem_used_percent"
],
"metrics_collection_interval": 60
}
}
}
}
# 위의 구성에 만족하는 지?
Are you satisfied with the above config? Note: it can be manually customized after the wizard completes to add additional items.
1. yes
2. no
default choice: [1]:
1
# 합치고 싶은 CloudWatch Agent의 설정 파일이 있는 지?
Do you have any existing CloudWatch Log Agent (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AgentReference.html) configuration file to import for migration?
1. yes
2. no
default choice: [2]:
2
# 로그 파일을 모니터링 할 건지?
Do you want to monitor any log files?
1. yes
2. no
default choice: [1]:
2
# CloudWatch Agent가 X-ray(AWS의 분산 추적 시스템)의 정보를 수집하게 할 건지?
Do you want the CloudWatch agent to also retrieve X-ray traces?
1. yes
2. no
default choice: [1]:
2
Existing config JSON identified and copied to: /opt/aws/amazon-cloudwatch-agent/etc/backup-configs
Saved config file to /opt/aws/amazon-cloudwatch-agent/bin/config.json successfully.
Current config as follows:
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root"
},
"metrics": {
"aggregation_dimensions": [
[
"InstanceId"
]
],
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}"
},
"metrics_collected": {
"disk": {
"measurement": [
"used_percent"
],
"metrics_collection_interval": 60,
"resources": [
"*"
]
},
"mem": {
"measurement": [
"mem_used_percent"
],
"metrics_collection_interval": 60
}
}
}
}
Please check the above content of the config.
The config file is also located at /opt/aws/amazon-cloudwatch-agent/bin/config.json.
Edit it manually if needed.
# 설정 정보를 AWS의 SSM parameter store(AWS의 값 저장소)에 저장할 건지?
Do you want to store the config in the SSM parameter store?
1. yes
2. no
default choice: [1]:
2
Program exits now.