Skip to main content

AWS Billing

Pack Assets​

Templates​

The Centreon Monitoring Connector AWS Billing brings a host template:

  • Cloud-Aws-Billing-custom

It brings the following Service Template:

Service AliasService TemplateService DescriptionDefault
Billing-Estimated-ChargesCloud-Aws-Billing-Estimated-Charges-ApiCheck AWS service estimated charges.X

Discovery rules​

The pack provides a discovery rule to automatically discover AWS services generating charges:

image

More information about the Host Discovery module is available in the Centreon documentation: Host Discovery

Collected metrics & status​

Metric NameDescription
billing.estimatedcharges.usdCheck Billing estimated charges for a service.

Prerequisites​

AWS Configuration​

Configure a service account (access/secret key combo) for which the following privileges have to be granted:

AWS PermissionDescription
cloudwatch:ListMetricsGet all services generating charges.
cloudwatch:getMetricStatisticsGet metrics from the AWS/Billing namespace on Cloudwatch.

Plugin dependencies​

To interact with Amazon APIs, you can use either use the awscli binary provided by Amazon or paws, a Perl AWS SDK (recommended). You must install it on every poller expected to monitor AWS resources.

For now, it is not possible to use paws if you are using a proxy to reach AWS Cloudwatch APIs.

yum install perl-Paws

Setup​

  1. Install the Centreon package on every Centreon poller expected to monitor AWS services generating charges:
yum install centreon-plugin-Cloud-Aws-Billing-Api
  1. On the Centreon Web interface, install the AWS Billing Centreon Monitoring Connector on the Configuration > Monitoring Connector Manager page.

Configuration​

Host​

  • Log into Centreon and add a new Host through Configuration > Hosts.
  • Set IP Address/DNS as 127.0.0.1.
  • Select the Cloud-Aws-Billing-custom template to apply to the host.
  • Once the template is applied, fill the corresponding macros. Some macros are mandatory.
MandatoryMacroDescription
XAWSSECRETKEYAWS Secret key of your IAM role. Password checkbox must be checked.
XAWSACESSKEYAWS Access key of your IAM role. Password checkbox must be checked.
XAWSREGIONMust be 'us-east-1'.
XAWSCUSTOMMODECustom mode to get metrics, 'awscli' is the default, you can also use 'paws' perl library.
XSERVICENAMEBilled AWS service name.
PROXYURLConfigure proxy URL.
EXTRAOPTIONSAny extra option you may want to add to every command_line (eg. a --verbose flag).
DUMMYSTATUSHost state. Default is OK, do not modify it until you know what you are doing.
DUMMYOUTPUTHost check output. Default is 'This is a dummy check'. Customize it with your own if needed.

How to check in the CLI that the configuration is OK and what are the main options for?​

Once the plugin is installed, log into your Centreon Poller CLI using the centreon-engine user account (su - centreon-engine) and test the Plugin by running the following command with the name of your backup vault:

/usr/lib/centreon/plugins//centreon_aws_billing_api.pl \
--plugin=cloud::aws::billing::plugin \
--mode=estimated-charges \
--custommode='awscli' \
--region=us-east-1 \
--aws-secret-key='xxx' \
--aws-access-key='xxx' \
--service='AWSBackup' \
--warning-billing='' \
--critical-billing='' \

The expected command output is shown below:

OK: Service 'AWSBackup' Estimated Charges: 0.85 USD | 'AWSBackup#billing.estimatedcharges.usd'=0.85USD;;;;

All available options for a given mode can be displayed by adding the --help parameter to the command:

/usr/lib/centreon/plugins//centreon_aws_billing_api.pl \
--plugin=cloud::aws::billing::plugin \
--mode=estimated-charges \
--help

All available modes can be displayed by adding the --list-mode parameter to the command:

/usr/lib/centreon/plugins//centreon_aws_billing_api.pl \
--plugin=cloud::aws::billing::plugin \
--list-mode

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.