Install the Amazon CloudWatch Agent on the instances. We want to monitor the memory usage mostly but the CPU & disk metrics are nice to have available too.
Connect to the instance and run the following:
$ wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
$ sudo dpkg -i amazon-cloudwatch-agent.debAdd the config from amazon-cloudwatch-agent.json to the cloudwatch agent config file at /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json
$ sudo vi /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.jsonOnce the config file is available, you can start the agent
$ sudo systemctl start amazon-cloudwatch-agent.service$ sudo systemctl status amazon-cloudwatch-agent.service # should be running
$ sudo journalctl -fu amazon-cloudwatch-agent # Any logs on startup
$ cat /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log # Check for errors in the agent logsOnce installed wait a couple of minutes. You should start to see metrics coming through under the mem_used_percent tag.