Created
February 11, 2020 13:08
-
-
Save kawanet/7005ea2d061c06c017dbfe757fa8e07d to your computer and use it in GitHub Desktop.
CloudWatch Agent 設定
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "agent": { | |
| "metrics_collection_interval": 60, | |
| "logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log", | |
| "region": "ap-northeast-1" | |
| }, | |
| "metrics": { | |
| "metrics_collected": { | |
| "cpu": { | |
| "measurement": [ | |
| "cpu_usage_active" | |
| ] | |
| }, | |
| "disk": { | |
| "measurement": [ | |
| "used_percent" | |
| ], | |
| "resources": [ | |
| "/" | |
| ] | |
| }, | |
| "mem": { | |
| "measurement": [ | |
| "mem_free" | |
| ] | |
| }, | |
| "processes": { | |
| "measurement": [ | |
| "processes_total" | |
| ] | |
| } | |
| } | |
| }, | |
| "logs": { | |
| "logs_collected": { | |
| "files": { | |
| "collect_list": [ | |
| { | |
| "file_path": "/opt/codedeploy-agent/deployment-root/*/*/logs/scripts.log", | |
| "log_group_name": "/opt/codedeploy-agent/deployment-root/logs/scripts", | |
| "timestamp_format": "%Y-%m-%d %H:%M:%S " | |
| }, | |
| { | |
| "file_path": "/var/log/aws/codedeploy-agent/codedeploy-agent.log", | |
| "timestamp_format": "%Y-%m-%d %H:%M:%S " | |
| }, | |
| { | |
| "file_path": "/var/log/nginx/access.log", | |
| "timestamp_format": " [%d/%b/%Y:%H:%M:%S %z] " | |
| }, | |
| { | |
| "file_path": "/var/log/nginx/error.log", | |
| "timestamp_format": "%Y/%m/%d %H:%M:%S " | |
| } | |
| ] | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| RUN yum install -y https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm | |
| /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -s -m auto -c file:amazon-cloudwatch-agent.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment