0

I am writing a Python script to determine which EC2 instances have CloudWatch agents installed and which do not. I got some information from CloudWatch Agent Troubleshooting but don't know how to implement it programmatically. Do I use SSM, EC2, or something else?

PyNerd
  • 555
  • 1
  • 6
  • 15

2 Answers2

1

I'm not aware of external visibility into the status of a particular EC2 instance's CloudWatch Agent.

If your EC2 instances have the SSM Agent preinstalled then you could use boto3 to invoke SSM Run Command to run a collector scripts on each instance (example).

jarmod
  • 59,580
  • 13
  • 95
  • 104
0

I think the boto3 function send_command is what I am looking for. Thanks, everybody.

PyNerd
  • 555
  • 1
  • 6
  • 15