Page History
...
Code Block |
---|
Invoke-WebRequest -Uri "https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi" -OutFile "C:\amazon-cloudwatch-agent.msi" |
Use the following command to install the Agent on Ubuntu:
...
Code Block |
---|
msiexec /i amazon-cloudwatch-agent.msi |
After installing the CloudWatch Agent, the user needs to be configured before it starts. It can be configured in two ways: by manually creating a config file or using the wizard (In which the user needs to answer a series of questions). It generates a config file.
...
Code Block |
---|
cd "C:\Program Files\Amazon\AmazonCloudWatchAgent" .\amazon-cloudwatch-agent-config-wizard.exe |
In the wizard run, the config.json file is automatically created. Before the creation of the config.json file, it asked for a number of questions as the Log Agent used to collect system-level metrics, so users need to answer these questions and can ignore the questions that are not related to collecting logs. While using the wizard, users can always take the generated config file and then manually add it to any additional instances.
Start the Agent
...
Code Block |
---|
& "C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1" -a fetch-config -m ec2 -s -c file:config.json |
View Logs
From the CloudWatch Overview, the user can select Logs from the menu. The user can find the label for the Log Group created in the configuration of Logs. Select the Log Group name to see the Log Streams. Click on the Log Stream uses the EC2 instance ID, so the user knows in which EC2 instance the data is logged.
...