You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yzl 93958d0fb0
zabbix6.0
1 year ago
..
README.md zabbix6.0 1 year ago
template_cloud_aws_cost_http.yaml zabbix6.0 1 year ago

README.md

AWS Cost Explorer by HTTP

Overview

The template to monitor AWS Cost Explorer by HTTP via Zabbix, which 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 Cost Explorer API calls to list and retrieve metrics. For more information, please refer to the (Cost Explorer pricing)[https://aws.amazon.com/aws-cost-management/aws-cost-explorer/pricing/] page.

Requirements

Zabbix version: 7.0 and higher.

Tested versions

This template has been tested on:

  • AWS by HTTP

Configuration

Zabbix should be configured according to the instructions in the Templates out of the box section.

Setup

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 metrics.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                 "ce:*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}

Set macros {$AWS.ACCESS.KEY.ID}, {$AWS.SECRET.ACCESS.KEY}.

For more information about managing access keys, see the official documentation.

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

Additional information about metrics and used API methods:

Macros used

Name Description Default
{$AWS.PROXY}

Sets HTTP proxy value. If this macro is empty, then no proxy is used.

{$AWS.ACCESS.KEY.ID}

Access key ID.

{$AWS.SECRET.ACCESS.KEY}

Secret access key.

{$AWS.BILLING.REGION}

Amazon Billing region code.

us-east-1
{$AWS.BILLING.MONTH}

Months to get historical data from AWS Cost Explore API, no more than 12 months.

11
{$AWS.BILLING.LLD.FILTER.SERVICE.MATCHES}

Filter of discoverable discovered billing service by name.

.*
{$AWS.BILLING.LLD.FILTER.SERVICE.NOT_MATCHES}

Filter to exclude discovered billing service by name.

CHANGE_IF_NEEDED

Items

Name Description Type Key and additional info
AWS Cost: Get monthly costs Script aws.get.monthly.costs

Preprocessing

  • Check for not supported value

    Custom on fail: Discard value

AWS Cost: Get daily costs

Get raw data on the daily costs by service

Script aws.get.daily.costs

Preprocessing

  • Check for not supported value

    Custom on fail: Discard value

LLD rule AWS daily costs by services discovery

Name Description Type Key and additional info
AWS daily costs by services discovery

Discovery of daily blended costs by services.

Dependent item aws.daily.services.costs.discovery

Preprocessing

  • JSON Path: $..Groups.first()

Item prototypes for AWS daily costs by services discovery

Name Description Type Key and additional info
AWS Cost: Service ["{#AWS.BILLING.SERVICE.NAME}"]: Blended daily cost

The daily blended cost of the {#AWS.BILLING.SERVICE.NAME} service for the previous day.

Dependent item aws.daily.service.cost["{#AWS.BILLING.SERVICE.NAME}"]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    Custom on fail: Discard value

LLD rule AWS monthly costs by services discovery

Name Description Type Key and additional info
AWS monthly costs by services discovery

Discovery of monthly costs by services.

Dependent item aws.cost.service.monthly.discovery

Preprocessing

  • JSON Path: $.monthly_service_costs

Item prototypes for AWS monthly costs by services discovery

Name Description Type Key and additional info
AWS Cost: ["{#AWS.BILLING.SERVICE.NAME}"]: Month ["{#AWS.BILLING.MONTH}"] Blended cost

The monthly cost by service {#AWS.BILLING.SERVICE.NAME}.

Dependent item aws.monthly.service.cost["{#AWS.BILLING.SERVICE.NAME}", "{#AWS.BILLING.MONTH}"]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    Custom on fail: Discard value

  • JSON Path: The text is too long. Please see the template.

    Custom on fail: Discard value

LLD rule AWS monthly costs discovery

Name Description Type Key and additional info
AWS monthly costs discovery

Discovery of monthly costs.

Dependent item aws.monthly.cost.discovery

Preprocessing

  • JSON Path: $.monthly_costs

Item prototypes for AWS monthly costs discovery

Name Description Type Key and additional info
AWS Cost: ["{#AWS.BILLING.MONTH}"]: Blended cost per month

The blended cost by month {#AWS.BILLING.MONTH}.

Dependent item aws.monthly.cost["{#AWS.BILLING.MONTH}"]

Preprocessing

  • JSON Path: The text is too long. Please see the template.

    Custom on fail: Discard value

  • Discard unchanged with heartbeat: 3h

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 at ZABBIX forums