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
  • 645
  • 2
  • 9
  • 19

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
  • 71,565
  • 16
  • 115
  • 122
0

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

PyNerd
  • 645
  • 2
  • 9
  • 19