Create Azure policies for metric collection

  • Rversion finale: Australia
  • Mis à jour 12 mars 2026
  • 3 minutes de lecture
  • Create your own policies to enable Azure to collect the metrics for the resources that have policies that don’t come with the base system. The Azure Metrics Collector check brings the metrics to the agent through the Azure Metrics Batch API.

    Avant de commencer

    • Ensure that the configuration Items (CIs) that you want to collect the metrics for are included in the CMDB. CIs are typically populated during Discovery.
    • Ensure that the sn_agent.multi_ci_dev_mode property is set to true on the System Properties page (All > System Properties > All Properties).

    Role required: agent_client_collector_admin

    Procédure

    1. Navigate to All > Agent Client Collector > Policies.
    2. Select New.
    3. Select the application scope icon Application scope icon. and verify that you are in the Agent Client Collector Monitoring scope.
    4. In the Name field, enter a name for the policy.
    5. Configure a filter that determines which CIs are to be monitored by the policy by selecting the Monitored CIs tab and the Monitored CI type by filter check box, as described in the following table.
      Tableau 1. Monitored CIs filter
      Option Action
      Monitored CI type Select the CI type to be monitored.

      The CI type must match the resource that you entered in the .json script file that contains the metrics to be monitored.

      <Filter fields> Configure the conditions that must be met for the resources in the specified Monitored CI type to be monitored.
      Ensure that you set the following conditions:
      • Object ID = <name of the resource entered in the .json script file that contains the metrics to be monitored>
      • State = Available

        The Available state indicates that resources must be available to be monitored.

      Preview Select to view the number of resources that match the specified condition.

      The number of matching results appears next to the Preview button. Select the result to view all CI records that match the condition.

    6. Add the Azure Metrics Collector check to the policy.
      1. On the Checks tab, locate the Azure Metrics Collector check in the Available cell.
      2. Select the right arrow button to move the check to the Selected cell.
    7. Configure a proxy server to access the Azure metrics.
      1. On the Proxy Settings tab, select Single proxy agent.
      2. In the Proxy agent field, select the proxy agent to execute the policy and retrieve the Azure metrics.
    8. Configure the credentials for the policy.
      1. Select the Credentials tab.
      2. In the Credential name field, select the azure_metrics_collector.
    9. Select Save.
    10. Add secure parameters to the check instance.
      1. In the policy's Check Instances section, select the Azure Metrics Collector check instance.
      2. On the Check Secure Parameters tab, select New.
      3. Add the secure check parameters that are described in the following table.
        Tableau 2. Secure check parameters
        Name Order value
        cred_tenant_id 1
        cred_client_id 2
        cred_secret_key 3

        Ensure that the Active check box is selected for each parameter.

      4. Select Update.
    11. Add the .json configuration file to the check instance.
      The file sends the list of Azure resources to the agent.
      1. Select the Azure Metrics Collector check instance.
      2. Select the Check Parameters subtab.
      3. Select New.
      4. On the form, fill in the fields.
        Tableau 3. Check Parameter form
        Field Description
        Name Descriptive name for the .json file to be added to the instance's configuration files (Agent Client Collector > Configuration Files).
        Value String that indicates the name of the .json file.

        For example: acc_azure_vm_metrics_config.json

        Flag Value that you enter (-c) to indicate that the check retrieves the name of the configuration file. The configuration file contains a namespace and a list of metrics. The value must indicate the name of the file that was uploaded to the list of configuration files (Agent Client Collector > Configuration Files), in .json format. For example: acc_azure_vm_metrics_config.json.

        Ensure that the Active, Mandatory, and Value required check boxes are selected.

      5. Select Submit.
    12. Create a .json file that indicates the metrics that you want your policy to monitor.
      The following example displays a .json file for retrieving load-balancer metrics.
      Azure metrics .json file.

      Add the .json file to the list of configuration files at Agent Client Collector > Configuration Files.

    13. Create a .json file to indicate the resources that you want your policy to monitor.
      1. On the Proxy Settings tab, select Multi-CI Mode.
      2. Copy a script from one of the Azure cloud policies that comes with the base system.
      3. Paste the script into the Config file creation script field of your policy.
      4. At the end of the script, configure the resource_id, region, and sys_id parameters with the values of the CI that you want the policy to monitor.
    14. Select Save and then publish the policy by selecting Publish.

    Résultats

    The configured policy retrieves the resources and their metrics from the specified Azure CI and sends them to the agent.