- Newest
- Most votes
- Most comments
The documentation here suggests that "describe-file-systems" can be used to check the status of the file.
https://docs.aws.amazon.com/fsx/latest/WindowsGuide/file-system-lifecycle-states.html
Since there is no option to filter by status in the request, we can use an if statement to display only those whose "Lifecycle" is "AVAILABLE".
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/fsx/client/describe_file_systems.html
This is a sample, but I thought the following would show only the available file storage capacity.
import boto3
client = boto3.client('fsx')
response = client.describe_file_systems()
file_systems_list = response['FileSystems']
for file_system in file_systems_list:
if file_system['Lifecycle'] == 'AVAILABLE':
print(file_system['FileSystemId'])
print(file_system['StorageCapacity'])
Hi,
You can get this information from CloudWatch Metrics programmatically.
Documentation on how you can get this with the CLI is available here:
https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/get-metric-statistics.html
The metric names will differ slightly based on which FSx you are using. You can list the available metrics using aws cloudwatch list-metrics --namespace AWS/FSx
Below is an example for FSx ONTAP, which will show the minimum storage used in the past 24hrs, you can change your start / end time and period to suit your needs.
aws cloudwatch get-metric-statistics --namespace AWS/FSx --metric-name StorageUsed --start-time "$(date -d '-1 day' '+%F %T')" --end-time "$(date -d '-1 hour' '+%F %T')" --period 86400 --statistics Minimum --region
eu-west-2 --dimensions Name=FileSystemId,Value=<<File System ID HERE>>
Relevant content
- asked 4 years ago
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago