Below is the command to restart the Amazon’s AWS CloudWatch agent:
sudo systemctl restart amazon-cloudwatch-agent
Verify the status of the agent by running the following command:
sudo systemctl status amazon-cloudwatch-agent
● amazon-cloudwatch-agent.service - Amazon CloudWatch Agent Loaded: loaded (/etc/systemd/system/amazon-cloudwatch-agent.service; disab> Active: active (running) since Thu 2022-08-11 12:08:26 UTC; 13s ago Main PID: 1960 (amazon-cloudwat) Tasks: 8 (limit: 9520) Memory: 13.3M CGroup: /system.slice/amazon-cloudwatch-agent.service └─1960 /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agen> Aug 11 12:08:26 ip-111-11-20-912 systemd: Started Amazon CloudWatch Agent.
The Active: active (running) status signifies that the CloudWatch agent has been actively runinng now.