title: How can I use Python (boto3) to determine which EC2 instances have CloudWatch agents?
body: <p>I am writing a Python script to determine which EC2 instances have CloudWatch agents installed and which do not.  I got some information from <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/troubleshooting-CloudWatch-Agent.html#CloudWatch-Agent-troubleshooting-verify-running" rel="nofollow noreferrer">CloudWatch Agent Troubleshooting</a> but don't know how to implement it programmatically.  Do I use SSM, EC2, or something else?</p>