0

I am trying to create a Python script to monitor my multiple AWS EC2 instances and I am using the Boto3 library.

I have gotten stuck when it comes to finding an available volume, as there is the method which returns the volume Id and total size, as described in: Boto3 get EC2 instance's volume.

Sean Mickey
  • 7,618
  • 2
  • 32
  • 58
  • 1
    Can you provide any code example of what you are trying to do and provide any error messages? – Marcin Aug 05 '20 at 12:34
  • Hi @Marcin, I am using boto3 library couldn't found any method to available/free space in aws instance. Please refer the link mentioned in question as an example of how I am working. – Talha Ansar Aug 05 '20 at 13:13

1 Answers1

0

There is no direct way of checking the available volume in EBS. AWS provides a way to send custom metrics to Cloudwatch using the Cloudwatch Unified Agent.

  1. Run the CloudWatch unified agent in all your EC2 instances.
  2. Send the custom metric (disk utilization) to Cloudwatch, using the agent.
  3. Use boto3 to check CloudWatch metric.

Check this link for more information