Skip to main content

Azure Management Costs

Pack Assets​

Templates​

The Centreon Plugin Pack Azure Costs brings a host template:

  • Cloud-Azure-Management-Costs-Api-custom

It brings the following service template:

Service AliasService TemplateService DescriptionDefaultDiscovery
BudgetCloud-Azure-Management-Costs-Budgets-ApiCheck consumption for a given budgetX
Costs-Explorer-Resource-GroupCloud-Azure-Management-Costs-Costs-Explorer-Resource-GroupCheck costs per resource groups
Costs-Explorer-SubscriptionCloud-Azure-Management-Costs-Costs-Explorer-SubscriptionCheck costs for the whole subscriptionX
Hybrid-Benefits-ComplianceCloud-Azure-Management-Costs-Hybrid-BenefitsCheck that hybrid benefits are enabled on all available resourcesX
Orphan-ResourcesCloud-Azure-Management-Costs-Orphan-ResourcesCheck the number of orphaned resourcesX
Tags-ComplianceCloud-Azure-Management-Costs-Tags-ComplianceCheck that required tag is

Discovery rules​

Rule nameDescription
Cloud-Azure-Management-Costs-BudgetsDiscover and list configured Azure budget

Collected metrics & status​

Metric NameUnit
azure.budget.consumption.currency

Prerequisites​

Check out the endpoint documentation here. It describes the required privileges to use the API.

Setup​

  1. Install the plugin package on every Centreon poller expected to monitor Azure Costs resources:
yum install centreon-plugin-Cloud-Azure-Management-Costs-Api
  1. On the Centreon web interface, on page Configuration > Plugin Packs, install the Azure Costs Centreon Plugin Pack.

Configuration​

Host​

  • Log into Centreon and add a new host through Configuration > Hosts.
  • Fill the Name, Alias & IP Address/DNS fields according to your Azure Costs server settings.
  • Apply the Cloud-Azure-Management-Costs-Api-custom template to the host.
  • Once the template is applied, fill in the corresponding macros. Some macros are mandatory.
MandatoryMacroDescription
XAZURECLIENTIDClient ID
XAZURECLIENTSECRETClient secret
XAZURESUBSCRIPTIONSubscription ID
XAZURETENANTTenant ID

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's CLI using the centreon-engine user account (su - centreon-engine) and test the plugin by running the following command:

/usr/lib/centreon/plugins/centreon_azure_management_costs_api.pl \
--plugin=cloud::azure::management::costs::plugin \
--mode=budgets \
--tenant='abcd1234-5678-90ab-cd12-34567890abcd' \
--client-id='9876dcba-5432-10dc-ba98-76543210dcba' \
--client-secret='8/RON4vUGhAcg6DRmSxc4AwgxSRoNfKg4d8xNizIMnwg=' \
--budget-name='myBudgetName' \
--lookup-days='30' \
--warning-usage='95' \
--critical-usage='98' \
--units='%' \
--verbose

The expected command output is shown below:

OK: Spent amount is 1400.25EUR on 1500EUR of allowed budget (93.33% consumption) for the past 30 days | 'azure.budget.consumption.currency'=1400.25;0:1425;0:1485;0;1500

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

/usr/lib/centreon/plugins/centreon_azure_management_costs_api.pl \
--plugin=cloud::azure::management::costs::plugin \
--mode=budgets \
--help

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

/usr/lib/centreon/plugins/centreon_azure_management_costs_api.pl \
--plugin=cloud::azure::management::costs::plugin \
--list-mode

Troubleshooting​

Please find the troubleshooting documentation for Centreon Plugins typical issues.