This topic describes how to troubleshoot issues for PATROL for Microsoft Azure.

PowerShell script to enable metrics in guest diagnostics

  1. Identify the Microsoft Windows machine on which you want to run the PowerShell script. The machine can be one of the VMs in the Azure cloud or one of the servers in your datacenter, like PATROL Agent machine.
  2. Download the Azure PowerShell Module from

  3. Copy the downloaded exe file WindowsAzurePowershellGetxxxxxxx.exe on the machine. Run the exe file. This setup will install the required .NET framework as well as PowerShell modules.

Running the PowerShell script

  1. Open the PowerShell prompt on the machine.
  2. Download the script from Knowledge Article KA000144431 (Support logon ID required).

  3. Copy the script to the current directory. For example, C:\Users\patrol as seen in the above screenshot.
  4. If you want to run the script to enable metrics of all the VMs in a subscription, run the script as .\EnableMetrics.ps1 -subscriptionId 5xxxxxxx-xxxxxxxxxxxx-xxxxxxxx8

  5. This script prompts for Azure portal login. Enter the credentials to login.

  6. The script fetchs all the VMs of the provided subscription id and enables the guest diagnostics on the VMs. It enables only the metrics that are required by the KM for monitoring.

Sample output

If you want to run the script for one VM, then you can provide the VM name and the resource group name in the parameters.

.\EnableMetrics.ps1 –subscriptionId 5xxxxxxxx-xxxx-xxxx-xxxxxxxxxx – targetResourceGroupName “MyResourceGroup” – targetVmName “MyVM”


The script works when it can find the storage account associated with each VM. If it is not able to find one, you can specify the storage account name while running the script.


Example 1:

Use myrgdiag1234 storage account for all VMs.

.\EnableMetrics.ps1 –subscriptionId 5xxxxxxx-xxxxxxxxxxxx-xxxxxxxx8 -targetStorage “myrgdiag1234”

Example 2:

Use myrgdiag1234 storage account for MyVM.

.\EnableMetrics.ps1 –subscriptionId 5xxxxxxx-xxxxxxxxxxxx-xxxxxxxx8 -targetResourceGroupName “MyResourceGroup” -targetVmName “MyVM” -targetStorage “myrgdiag1234”

Enable or disable KM debug

If you encounter certain problems using this KM, BMC Support might request you to enable the debug. Follow one of the three options to enable debug.

Using PATROL configuration variable

  1. Access the /PAF/Azure_Accounts/<AccountLabel>/DEBUG pconfig variable
  2. Set this variable to 1 to enable the debug, and set to 0 to disable the debug

Using the PATROL Console

  1. From the PATROLMainMap tree, right click <AccountLabel> > KM commands > Debug > Select the check box or clear to disable

Using the TrueSight console

  1. Edit the KM policy and select the Enable Debug check box. Clear the check box to disable.

The log file is located at %PATROL_HOME%\pmy\log directory on Windows and $PATROL_HOME/../pmy/log directory on Linux. The log file name is <PATROLAgentName>-<Port>-<AccountLabel>-AzureSubscription.log.

By default, the maximum size of the log file is 10 MB. It’s a circular log file and will have maximum of 10 instances. (100 MB)


The more information you gather, the higher the load on your system. When you are finished debugging the problem that you were experiencing, remember to turn off the debug mode by clearing all logging options in the Debug dialog box.

Other issues

BMC recommends to check the following parameters for any basic monitoring issues:

  • ConfigurationStatus - Available at top level container Microsoft Azure. Reports errors related to JAVA process launch.
  • State - Available at individual application class level containers. Reports if monitoring is ON or OFF.
  • MonitoringStatus - Available at individual application class level containers. Reports errors related to data collection failures for respective application classes.

For any other issues, contact BMC support with log files from the <PATROL_HOME>\pmy\log directory.

Was this page helpful? Yes No Submitting... Thank you