Amazon S3: Monitor current drive and bandwidth usage with PHP?

Is it possible to create a basic script using PHP so that I can be warned (for example, by email) if a particular bucket already uses a 100 GB disk or 100 GB bandwidth from Amazon S3?

+4
source share
2 answers

You can use amp php library to get bucket size programmatically.

http://docs.amazonwebservices.com/AWSSDKforPHP/latest/#m=AmazonS3/get_bucket_filesize is an example of how to do this. Using the above example, you can create a simple function that gets the dimensions of all your buckets. If they exceed your size threshold, you can send yourself an email. If you are running UNIX, you can configure crontab to run this script every x times.

Amazon may offer bandwidth notifications via email. Did you conduct any investigation of yourself?

+1
source

Source: https://habr.com/ru/post/1391666/


All Articles