Menu
AWS Storage Gateway
User Guide (API Version 2013-06-30)

Monitoring Your File Share

You can monitor your file share by using Amazon CloudWatch metrics and use Amazon CloudWatch Events to get notified when your files are uploaded to AWS. For information about file gateway type metrics, see Monitoring Your Gateway and Resources.

Getting File Upload Notification

AWS Storage Gateway can send a notification through CloudWatch Events when all files written to your file share up to that point have been uploaded to Amazon S3. These files include files written to the NFS file share, up to the time that you make a request for notification.

When the upload is done, AWS Storage Gateway sends you notification through CloudWatch Events. You can configure CloudWatch Events to send the notification through event targets such as Amazon SNS, Amazon SQS or AWS Lambda function. For example, you can configure an Amazon SNS target, to send the notification Amazon SNS consumers such as email and text message. For information about CloudWatch Events, see What is Amazon CloudWatch Events?.

To get notified when file upload is done

  1. Open the AWS Storage Gateway console at https://console.aws.amazon.com/storagegateway/home.

  2. Choose File share.

  3. Choose the file share you want to get notification for.

  4. Choose Actions, choose Get upload notification, and then choose OK to exit the dialog box.

To set up CloudWatch Events notification, you do the following.

  • Create a target such as an Amazon SNS topic or Lambda function to invoke when the file upload event in AWS Storage Gateway is triggered.

  • Create a rule in the Amazon CloudWatch Events Console to invoke targets based on an event in AWS Storage Gateway. In the rule, create an event patten for the Storage Gateway File Upload Event. The notification is triggered when the event matches this rule pattern.

    The following example shows a rule that triggers an file upload event in the specified gateway and in the specified AWS Region.

    Copy
    { "source":[ "aws.storagegateway" ], "resource":[ "arn:aws:storagegateway:AWS Region:account-id :gateway/gateway-id" ], "detail-type":[ "Storage Gateway File Upload Event" ] }
  • Select the target and configure the settings.

For information about how to create a CloudWatch Events see Getting Started with Amazon CloudWatch Events.

Example File Upload Notification Example

The following example shows a file upload notification that is sent to you through when the event matches the rule you created. This notification is in JSON format. You can configure this notification to be delivered to the target message.

Copy
{ "id" : "2649b160-d59d-c97f-3f64-8aaa9ea6aed3", "version" : "0", "account" : "209870788375", "source" : "aws.storagegateway", "resources" : [ "arn:aws:storagegateway:us-east-1:123456789011:share/share-F123D451", "arn:aws:storagegateway:us-east-1:346332347513:gateway/sgw-712345DA", "arn:aws:s3:::mybucket-sgw-aabbcc" ], "detail" : { "event-type" : "upload-complete", "notification-id" : "da8db69f-6351-4205-829b-4e82607a00fe", "completed" : "2017-11-06T21:34:53Z", "request-received" : "2017-11-06T21:34:42Z" }, "detail-type" : "Storage Gateway File Upload Event", "region" : "us-east-1", "time" : "2017-11-06T21:34:42Z" }

File Upload Notification Use Case

You could have two file gateways that mapped to the same Amazon S3 bucket and the NFS client for Gateway1 uploads new files to S3. The files will upload to S3 but they will not appear in Gateway2 because it uses a locally cached version of files in S3. To make the files visible in gateway2, you can request file upload notification from Gateway1 to notify you when the upload is done. You can then use the CloudWatch Events to automatically issue RefreshCache request for the file share on Gateway2. When the RefreshCache request completes the new files will be visible in Gateway2.

Understanding File Share Metrics

You can find information following about the Storage Gateway metrics that cover file shares. Each file share has a set of metrics associated with it. Some file share-specific metrics have the same name as certain gateway-specific metrics. These metrics represent the same kinds of measurements but are scoped to the file share instead. Always specify whether you want to work with either a gateway or a file share metric before working with a metric. Specifically, when working with file share metrics, you must specify the File share ID that identifies the file share for which you are interested in viewing metrics. For more information, see Using Amazon CloudWatch Metrics.

The following table describes the Storage Gateway metrics that you can use to get information about your file shares.

Metric Description
CacheHitPercent

Percent of application read operations from the file shares that are served from cache. The sample is taken at the end of the reporting period.

When there are no application read operations from the file share, this metric reports 100 percent.

Units: Percent

CachePercentDirty

The file share's contribution to the overall percentage of the gateway's cache that has not been persisted to AWS. The sample is taken at the end of the reporting period.

Use the CachePercentDirty metric of the gateway to view the overall percentage of the gateway's cache that has not been persisted to AWS. For more information, see Understanding Gateway Metrics.

Units: Percent

CachePercentUsed

The file share's contribution to the overall percent use of the gateway's cache storage. The sample is taken at the end of the reporting period.

Use the CachePercentUsed metric of the gateway to view overall percent use of the gateway's cache storage. For more information, see Understanding Gateway Metrics.

Units: Percent

ReadBytes

The total number of bytes read from your on-premises applications in the reporting period for a file share.

Use this metric with the Sum statistic to measure throughput and with the Samples statistic to measure IOPS.

Units: Bytes

ReadTime

The total number of milliseconds spent to do read operations from your on-premises applications in the reporting period.

Use this metric with the Average statistic to measure latency.

Units: Milliseconds

WriteBytes

The total number of bytes written to your on-premises applications in the reporting period.

Use this metric with the Sum statistic to measure throughput and with the Samples statistic to measure IOPS.

Units: Bytes

WriteTime

The total number of milliseconds spent to do write operations from your on-premises applications in the reporting period.

Use this metric with the Average statistic to measure latency.

Units: Milliseconds