Search

EC2

CloudWatchAgentServerPolicy
sudo yum install -y rsyslog sudo systemctl start rsyslog sudo systemctl enable rsyslog
Shell
복사
sudo yum install amazon-cloudwatch-agent -y
Shell
복사
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
Shell
복사
Check
cat << EOF > /opt/aws/amazon-cloudwatch-agent/bin/config.json { "agent": { "metrics_collection_interval": 60, "region": "ap-northeast-2" }, "logs": { "logs_collected": { "files": { "collect_list": [ { "file_path": "/var/log/secure", "log_group_name": "/wsi/security/bastion-ssh", "log_stream_name": "login" } ] } } } } EOF
Shell
복사
amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json
Shell
복사