AWS S3

Amazon S3 (Simple Storage Service) is a cloud computing web service offered by Amazon Web Services (AWS). Amazon S3 provides object storage through web services interface.

Available solutions




This template is for Zabbix version: 6.2

Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/cloud/AWS/aws_s3_http?at=release/6.2

AWS S3 bucket by HTTP

Overview

For Zabbix version: 6.2 and higher
The template to monitor AWS S3 bucket by HTTP via Zabbix that works without any external scripts.
Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. NOTE This template uses the GetMetricData CloudWatch API calls to list and retrieve metrics. For more information, please refer to the (CloudWatch pricing)[https://aws.amazon.com/cloudwatch/pricing/] page.

Additional information about metrics and used API methods:

Setup

See Zabbix template operation for basic instructions.

The template gets AWS S3 metrics and uses the script item to make HTTP requests to the CloudWatch API.

Before using the template, you need to create an IAM policy for the Zabbix role in your AWS account with the necessary permissions.

Add the following required permissions to your Zabbix IAM policy in order to collect Amazon S3 metrics.

{
    "Version":"2012-10-17",
    "Statement":[
        {
          "Action":[
              "cloudwatch:Describe*",
              "cloudwatch:Get*",
              "cloudwatch:List*"
          ],
          "Effect":"Allow",
          "Resource":"*"
        }
    ]
  }

To gather Request metrics, enable Requests metrics on your Amazon S3 buckets from the AWS console.

Set the macros "{$AWS.ACCESS.KEY.ID}", "{$AWS.SECRET.ACCESS.KEY}", "{$AWS.REGION}", "{$AWS.S3.FILTER.ID}", "{$AWS.S3.BUCKET.NAME}"

For more information about manage access keys, see official documentation

Also, see the Macros section for a list of macros used by LLD filters.

Additional information about metrics and used API methods:

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$AWS.ACCESS.KEY.ID}

Access key ID.

``
{$AWS.REGION}

Amazon S3 Region code.

us-west-1
{$AWS.S3.BUCKET.NAME}

S3 bucket name.

``
{$AWS.S3.FILTER.ID}

S3 bucket requests filter identifier.

``
{$AWS.S3.LLD.FILTER.ALARM_NAME.MATCHES}

Filter of discoverable alarms by name.

.*
{$AWS.S3.LLD.FILTER.ALARM_NAME.NOT_MATCHES}

Filter to exclude discovered alarms by name.

CHANGE_IF_NEEDED
{$AWS.SECRET.ACCESS.KEY}

Secret access key.

``

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
Bucket Alarms discovery

Discovery bucket alarms.

DEPENDENT aws.s3.alarms.discovery

Preprocessing:

- JAVASCRIPT: The text is too long. Please see the template.

- DISCARD_UNCHANGED_HEARTBEAT: 3h

Filter:

AND

- {#ALARM_NAME} MATCHES_REGEX {$AWS.S3.LLD.FILTER.ALARM_NAME.MATCHES}

- {#ALARM_NAME} NOT_MATCHES_REGEX {$AWS.S3.LLD.FILTER.ALARM_NAME.NOT_MATCHES}

Items collected

Group Name Description Type Key and additional info
AWS S3 AWS S3: Get metrics check

Data collection check.

DEPENDENT aws.s3.metrics.check

Preprocessing:

- JSONPATH: $.error

⛔️ON_FAIL: CUSTOM_VALUE ->

- DISCARD_UNCHANGED_HEARTBEAT: 3h

AWS S3 AWS S3: Get alarms check

Data collection check.

DEPENDENT aws.s3.alarms.check

Preprocessing:

- JSONPATH: $.error

⛔️ON_FAIL: CUSTOM_VALUE ->

- DISCARD_UNCHANGED_HEARTBEAT: 3h

AWS S3 AWS S3: Bucket Size

This a daily metric for the bucket.

The amount of data in bytes stored in a bucket in the STANDARD storage class, INTELLIGENT_TIERING storage class, Standard-Infrequent Access (STANDARD_IA) storage class, OneZone-Infrequent Access (ONEZONE_IA), Reduced Redundancy Storage (RRS) class, S3 Glacier Instant Retrieval storage class, Deep Archive Storage (S3 Glacier Deep Archive) class or, S3 Glacier Flexible Retrieval (GLACIER) storage class. This value is calculated by summing the size of all objects and metadata in the bucket (both current and noncurrent objects), including the size of all parts for all incomplete multipart uploads to the bucket.

DEPENDENT aws.s3.bucket_size_bytes

Preprocessing:

- JSONPATH: $.[?(@.Label == "BucketSizeBytes")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Number of objects

This a daily metric for the bucket.

The total number of objects stored in a bucket for all storage classes.

This value is calculated by counting all objects in the bucket (both current and noncurrent objects) and the total number of parts for all incomplete multipart uploads to the bucket.

DEPENDENT aws.s3.number_of_objects

Preprocessing:

- JSONPATH: $.[?(@.Label == "NumberOfObjects")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: All

The total number of HTTP requests made to an Amazon S3 bucket, regardless of type.

If you're using a metrics configuration with a filter, then this metric only returns the HTTP requests that meet the filter's requirements.

DEPENDENT aws.s3.all_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "AllRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Get

The number of HTTP GET requests made for objects in an Amazon S3 bucket. This doesn't include list operations.

Paginated list-oriented requests, like List Multipart Uploads, List Parts, Get Bucket Object versions, and others, are not included in this metric.

DEPENDENT aws.s3.get_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "GetRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Put

The number of HTTP PUT requests made for objects in an Amazon S3 bucket.

DEPENDENT aws.s3.put_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "PutRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Delete

The number of HTTP DELETE requests made for objects in an Amazon S3 bucket.

This also includes Delete Multiple Objects requests. This metric shows the number of requests, not the number of objects deleted.

DEPENDENT aws.s3.delete_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "DeleteRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Head

The number of HTTP HEAD requests made to an Amazon S3 bucket.

DEPENDENT aws.s3.head_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "HeadRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Post

The number of HTTP POST requests made to an Amazon S3 bucket.

Delete Multiple Objects and SELECT Object Content requests are not included in this metric.

DEPENDENT aws.s3.post_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "PostRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Select

The number of Amazon S3 SELECT Object Content requests made for objects in an Amazon S3 bucket.

DEPENDENT aws.s3.select_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "SelectRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Select, bytes scanned

The number of bytes of data scanned with Amazon S3 SELECT Object Content requests in an Amazon S3 bucket.

Statistic: Average (bytes per request).

DEPENDENT aws.s3.select_bytes_scanned

Preprocessing:

- JSONPATH: $.[?(@.Label == "SelectBytesScanned")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Select, bytes returned

The number of bytes of data returned with Amazon S3 SELECT Object Content requests in an Amazon S3 buckets.

Statistic: Average (bytes per request).

DEPENDENT aws.s3.select_bytes_returned

Preprocessing:

- JSONPATH: $.[?(@.Label == "SelectBytesReturned")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: List

The number of HTTP requests that list the contents of a bucket.

DEPENDENT aws.s3.list_requests

Preprocessing:

- JSONPATH: $.[?(@.Label == "ListRequests")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Bytes downloaded

The number of bytes downloaded for requests made to an Amazon S3 bucket, where the response includes a body.

Statistic: Average (bytes per request).

DEPENDENT aws.s3.bytes_downloaded

Preprocessing:

- JSONPATH: $.[?(@.Label == "BytesDownloaded")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Bytes uploaded

The number of bytes uploaded that contain a request body, made to an Amazon S3 bucket.

Statistic: Average (bytes per request).

DEPENDENT aws.s3.bytes_uploaded

Preprocessing:

- JSONPATH: $.[?(@.Label == "BytesUploaded")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Errors, 4xx

The number of HTTP 4xx client error status code requests made to an Amazon S3 bucket with a value of either 0 or 1.

The average statistic shows the error rate, and the sum statistic shows the count of that type of error, during each period.

Statistic: Average (reports per request).

DEPENDENT aws.s3.4xx_errors

Preprocessing:

- JSONPATH: $.[?(@.Label == "4xxErrors")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Requests: Errors, 5xx

The number of HTTP 5xx server error status code requests made to an Amazon S3 bucket with a value of either 0 or 1.

The average statistic shows the error rate, and the sum statistic shows the count of that type of error, during each period.

Statistic: Average (reports per request).

DEPENDENT aws.s3.5xx_errors

Preprocessing:

- JSONPATH: $.[?(@.Label == "5xxErrors")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: First byte latency, avg

The per-request time from the complete request being received by an Amazon S3 bucket to when the response starts to be returned.

Statistic: Average.

DEPENDENT aws.s3.first_byte_latency.avg

Preprocessing:

- JSONPATH: $.[?(@.Label == "FirstByteLatency")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: First byte latency, p90

The per-request time from the complete request being received by an Amazon S3 bucket to when the response starts to be returned.

Statistic: 90 percentile.

DEPENDENT aws.s3.first_byte_latency.p90

Preprocessing:

- JSONPATH: $.[?(@.Label == "FirstByteLatency")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Total request latency, avg

The elapsed per-request time from the first byte received to the last byte sent to an Amazon S3 bucket.

This includes the time taken to receive the request body and send the response body, which is not included in FirstByteLatency.

Statistic: Average.

DEPENDENT aws.s3.total_request_latency.avg

Preprocessing:

- JSONPATH: $.[?(@.Label == "TotalRequestLatency")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Total request latency, p90

The elapsed per-request time from the first byte received to the last byte sent to an Amazon S3 bucket.

This includes the time taken to receive the request body and send the response body, which is not included in FirstByteLatency.

Statistic: 90 percentile.

DEPENDENT aws.s3.total_request_latency.p90

Preprocessing:

- JSONPATH: $.[?(@.Label == "TotalRequestLatency")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Replication: Latency

The maximum number of seconds by which the replication destination Region is behind the source Region for a given replication rule.

DEPENDENT aws.s3.replication_latency

Preprocessing:

- JSONPATH: $.[?(@.Label == "ReplicationLatency")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Replication: Bytes pending

The total number of bytes of objects pending replication for a given replication rule.

DEPENDENT aws.s3.bytes_pending_replication

Preprocessing:

- JSONPATH: $.[?(@.Label == "BytesPendingReplication")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3: Replication: Operations pending

The number of operations pending replication for a given replication rule.

DEPENDENT aws.s3.operations_pending_replication

Preprocessing:

- JSONPATH: $.[?(@.Label == "OperationsPendingReplication")].Values.first().first()

⛔️ON_FAIL: DISCARD_VALUE ->

AWS S3 AWS S3 Alarms: ["{#ALARM_NAME}"]: State reason

An explanation for the alarm state, in text format.

Alarm description:

{#ALARM_DESCRIPTION}

DEPENDENT aws.s3.alarm.state_reason["{#ALARM_NAME}"]

Preprocessing:

- JSONPATH: $.[?(@.AlarmName == "{#ALARM_NAME}")].StateReason.first()

⛔️ON_FAIL: DISCARD_VALUE ->

- DISCARD_UNCHANGED_HEARTBEAT: 3h

AWS S3 AWS S3 Alarms: ["{#ALARM_NAME}"]: State

The state value for the alarm. Possible values: 0 (OK), 1 (INSUFFICIENT_DATA), 2 (ALARM).

Alarm description:

{#ALARM_DESCRIPTION}

DEPENDENT aws.s3.alarm.state["{#ALARM_NAME}"]

Preprocessing:

- JSONPATH: $.[?(@.AlarmName == "{#ALARM_NAME}")].StateValue.first()

⛔️ON_FAIL: CUSTOM_VALUE -> 3

- JAVASCRIPT: var state = ['OK', 'INSUFFICIENT_DATA', 'ALARM']; return state.indexOf(value.trim()) === -1 ? 255 : state.indexOf(value.trim());

Zabbix raw items AWS S3: Get metrics data

Get bucket metrics.

Full metrics list related to S3: https://docs.aws.amazon.com/AmazonS3/latest/userguide/metrics-dimensions.html

SCRIPT aws.s3.get_metrics

Preprocessing:

- CHECK_NOT_SUPPORTED

⛔️ON_FAIL: DISCARD_VALUE ->

Expression:

The text is too long. Please see the template.
Zabbix raw items AWS S3: Get alarms data

Get alarms data.

DescribeAlarms API method: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html

SCRIPT aws.s3.get_alarms

Preprocessing:

- CHECK_NOT_SUPPORTED

⛔️ON_FAIL: DISCARD_VALUE ->

Expression:

The text is too long. Please see the template.

Triggers

Name Description Expression Severity Dependencies and additional info
AWS S3: Failed to get metrics data

-

length(last(/AWS S3 bucket by HTTP/aws.s3.metrics.check))>0 WARNING
AWS S3: Failed to get alarms data

-

length(last(/AWS S3 bucket by HTTP/aws.s3.alarms.check))>0 WARNING
AWS S3 Alarms: "{#ALARM_NAME}" has 'Alarm' state

Alarm "{#ALARM_NAME}" has 'Alarm' state.

Reason: {ITEM.LASTVALUE2}

last(/AWS S3 bucket by HTTP/aws.s3.alarm.state["{#ALARM_NAME}"])=2 and length(last(/AWS S3 bucket by HTTP/aws.s3.alarm.state_reason["{#ALARM_NAME}"]))>0 AVERAGE
AWS S3 Alarms: "{#ALARM_NAME}" has 'Insufficient data' state

-

last(/AWS S3 bucket by HTTP/aws.s3.alarm.state["{#ALARM_NAME}"])=1 INFO

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template or ask for help with it at ZABBIX forums.

Articles and documentation

+ Propose new article

Didn't find integration you need?