Enable CloudWatch Agent for A51 Dashboard

aMiSTACX Monitoring Dashboard for AWS CloudWatch

Our A51 dashboard supports Advanced Monitoring with AWS CloudWatch. This new feature will allow history on some important local EC2 metrics such as disk space available, memory usage, CPU utilization, CPU credits and more.

Should your stack not have the CloudWatch Agent, please follow these simple steps to install on a G6/G5 stack.

Note: Newer stacks Feb 2023+ will start to have an install script in /var/www/utility, and may also offer deployment via CFT.

Download and Install CWA:

Ubuntu:

from shell root:

wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
sudo dpkg -i -E ./amazon-cloudwatch-agent.deb

Windows:

https://s3.amazonaws.com/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi
msiexec /i amazon-cloudwatch-agent.msi

Install CloudWatch Agent Dependency on Ubuntu:

sudo apt-get install collectd

sudo reboot

SFTP config.json File to Server:

Copy this config.json file to this directory on the Ubuntu EC2: /opt/aws/amazon-cloudwatch-agent/bin/

or create and copy and paste contents with sudo nano /opt/aws/amazon-cloudwatch-agent/bin/config.json

Initilize and First-Start CW Agent

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

Useful Commands:

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -m ec2 -a {status, start, stop}

Note: Manual stop prevents auto-start on reboot

Video shows deployment and configuration process.

Advanced CLI Options

sudo systemctl {start, restart} amazon-cloudwatch-agent.service

sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/bin/config.json -s

Troubleshooting

The A51 console should show two operational states: Green = Operational no Alarm status, or Red = Alarm status. You will also see an orange state when an alarm is first created. If orange state persists, please ref this article on how to troubleshoot:

https://aws.amazon.com/premiumsupport/knowledge-center/cloudwatch-alarm-insufficient-data-state/

Local CloudWatch logs can be found here:

/opt/aws/amazon-cloudwatch-agent/logs

Should you need further assistance, please contact support or ping our bot.