Skip to main content

Azure InsightsMetrics

Overview​

This Pack is in an experimental state (version 2.x.X).

The Centreon Pack Azure InsightsMetrics aims to monitor additional indicators that are not available on the Azure Monitor feature. For this, it runs KustoQL based queries on the InsightsMetrics database reachable through the Azure LogAnalytics API. For example, using this Pack will allow you to monitor system indicators of Azure Virtual Machines resources (CPU, memory, disks...).

The associated Plugin is only compatible with the 'api' custom-mode. 'azcli' is not supported for this usage.

Pack Assets​

Monitored Objects​

Available indicators and metrics:

  • Azure Virtual Machines
    • CPU
    • Memory
    • Logical-Disks

Collected metrics & status​

Metric NameDescriptionUnit
instance#azure.insights.cpu.average.utilization.percentageAverage utilization percentage%
instance~ID#azure.insights.cpu.core.utilization.percentageCurrent utilization per core%

Discovery rules​

Rule nameDescription
Cloud-Azure-Management-InsightsMetrics-Api-VirtualMachine-Logical-Disks-NameDiscover logical disks associated to Azure Virtual Machines

Prerequisites​

Please find all the prerequisites needed for Centreon to get information from Azure on the dedicated page.

Setup​

  1. Install the Centreon Plugin on every Centreon Poller expected to monitor Azure resources based on InsightsMetrics:
yum install centreon-plugin-Cloud-Azure-Management-InsightsMetrics-Api
  1. On the Centreon Web interface, install the Azure InsightsMetrics Centreon Pack on the Configuration > Monitoring Connector Manager page.

Configuration​

Host​

  • Log into Centreon and add a new Host through Configuration > Hosts.

  • In the IP Address/FQDN field, set the following IP address: '127.0.0.1'.

  • Select the appropriate Cloud-Azure-Management-InsightsMetrics-XXX-custom template to apply to the Host (for example, choose Cloud-Azure-Management-InsightsMetrics-VirtualMachine-custom for an Azure VM resource).

  • Once the template applied, some Macros marked as 'Mandatory' hereafter have to be configured.

MandatoryNomDescription
XAZURECUSTOMMODECustom mode 'api'
XAZURELOGANALYTICSENDPOINTLogAnalytics endpoint (default: https://api.loganalytics.io)
XAZURESUBSCRIPTIONSubscription ID
XAZUREWORKSPACEIDLogAnalytics workspace ID
XAZURETENANTTenant ID
XAZURECLIENTIDClient ID
XAZURECLIENTSECRETClient secret
XAZURERESOURCEfull ID of the resource to monitor

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

Once the Plugin installed, log into your Centreon Poller CLI using the centreon-engine user account and test the Plugin by running the following command:

/usr/lib/centreon/plugins//centreon_azure_management_insightsmetrics_api.pl \
--plugin=cloud::azure::management::insightsmetrics::plugin \
--mode=cpu --custommode='api' --management-endpoint='https://api.loganalytics.io' \
--subscription='xxxxxxxxx' --tenant='xxxxxxx' --client-id='xxxxxxxx' --client-secret='xxxxxxxxxx' \
--workspace-id='xxxxxxxxxxxxxxx' \
--filter-resourceid='/subscriptions/XXXX/resourcegroups/my_resourcegroup1/providers/microsoft.compute/virtualmachines/my_vm1' \
--warning-average-utilization-percentage='90' \
--critical-average-utilization-percentage='95'

Expected command output is shown below:

OK: 2 CPU(s) average utilization: 2.18 % - All CPUs are ok | 'azure.insights.cpu.average.utilization.percentage'=2.18%;0:90;0:95;0;100
'1#azure.insights.cpu.core.utilization.percentage'=2.12%;;;0;100 '2#azure.insights.cpu.core.utilization.percentage'=2.25%;;;0;100
Computer 'my_vm1'
2 CPU(s) average utilization: 2.18 %
CPU #1 usage : 2.12 %
CPU #2 usage : 2.25 %

The command above checks the CPU of an Azure Virtual Machine account using the 'api' custom-mode targetting the LogAnalytics API (--plugin=cloud::azure::management::insightsmetrics::plugin --mode=cpu --custommode=api --management-endpoint='https://api.loganalytics.io'). The authentication parameters to be used with the custom mode are specified in the options (--subscription='xxxxxxxxx' --tenant='xxxxxxx' --client-id='xxxxxxxx' --client-secret='xxxxxxxxxx'). The Resource ID of the Azure VM my_vm1 is specified in the filter (--filter-resourceid='/subscriptions/XXXX/resourcegroups/my_resourcegroup1/providers/microsoft.compute/virtualmachines/my_vm1').

This command would trigger a WARNING alarm if the average utilization is reported as over 90% (--warning-average-utilization-percentage='90') and a CRITICAL alarm over 95% (--critical-average-utilization-percentage='95').

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

/usr/lib/centreon/plugins/centreon_azure_management_insightsmetrics_api.pl \
--plugin=cloud::azure::management::insightsmetrics::plugin \
--mode=cpu
--help

Troubleshooting​

Please find all the troubleshooting documentation for the API-based Plugins in the dedicated chapter of the Centreon documentation.