You are here

Azure Windows VMs

Requires Opsview 6
check_circle
Opsview Supported

404: Not Found

Included in the Cloud - Azure Opspack

Host Template: Cloud - Azure - Windows VMs

Azure Windows VMs allow you to monitor various performance metrics for Windows virtual machines, these include metrics for Logical Disk, Memory, Processor, System and Heartbeat.

The service checks in This Host Template are designed to complement the service checks in the Azure - Virtual Machines Host Template (which works for both Linux and Windows VMs). If installed, This Host Template will provide a set of metrics for Windows VMs comparable to the OS - Windows Base Opspack. Configuring it requires administrator-level permissions for Azure, or the help of an administrator.

How does This Host Template differ from OS - Windows Base?

Using OS - Windows Base requires the installation of an Opsview Agent for Windows on the target VM - this may be computationally heavy and intrusive for use with small VMs or highly dynamic environments, or where Microsoft solutions are preferred.

However, OS - Windows Base does not require Azure administrator permissions, only the ability to launch and configure a VM with internet connectivity and adjust security groups to let the agent communicate with the Opsview Master.

What does This Host Template offer above Azure - Virtual Machines?

The Azure - Virtual Machines Host Template offers the ability to track VM read/write operations, network traffic in and out, and CPU load. These metrics are gathered via Azure API calls using an administrator defined "Application" or "Service Principal".

This Host Template complements Azure - Virtual Machines by offering extended metrics including memory utilization, processor queue length, processor time, logical disk space, heartbeats, and restart/shutdown history. This requires the additional use a Microsoft-approved, open source log analytics agent, called the Log Analytics VM Extension, which Azure can auto-install on your target VM when you enable Azure Log Analytics (see Instructions: Setup Azure Log Analytics).

This Host Template allows you to monitor the performance metrics for Windows virtual machines - in particular memory utilization, processor queue length, processor time, logical disk space, heartbeats, and restart/shutdown history.

This Host Template includes the following Service Checks:

Service Check Name Description Default Thresholds (Warning, Critical) UOM
Azure - Windows VM - Memory The percentage of used memory and the available memory in bytes [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - Processor Time The percentage of processor time [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - Processor Queue Length The processor queue length [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - Logical Disk Space The percentage of free space and the amount of free space in bytes [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - System Uptime The system uptime [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - Heartbeat The time between the last two heartbeats [Default Timespan = 5mins, Granularity = 5mins] N/A NA
Azure - Windows VM - Restarts The number of restarts, and information on the user and comment history [Default Timespan = 1440mins, Granularity = 1440mins] N/A NA
Azure - Windows VM - Shutdowns The number of shutdowns, and information on the user and comment history [Default Timespan = 1440mins, Granularity = 1440mins] N/A NA

Setup Azure Log Analytics

This Opspack utilises Azure Log Analytics to collect data directly from your Azure Virtual Machines. To enable Azure Log Analytics follow the steps outlined below. If you already have an Azure Workspace, you can skip Step 1.

Step 1: Create a Workspace

In the Azure portal, click All Services and filter for Log Analytics. Select Log Analytics.

Filter Log Analytics

Click Add, and then fill in the fields as described:

  • Provide a name for your new OMS Workspace, such as DefaultWorkspace.
  • Select a Subscription from the drop-down list.
  • Select an existing Resource Group or create a new one.
  • Select the Location your VMs are deployed to.
  • Select the Pricing Tier you use.

Create a Workspace

After providing the required fields, on the OMS Workspace pane, click OK.

From the list of Log Analytics workspaces, select the workspace you just created.

From the left-hand menu, select Overview.

Make a note of the Workspace Id as this will be required when configuring the Opspack.

Find Workspace Id

Step 2: Enable the Log Analytics VM Extension

Log Analytics can be enabled on existing Azure Linux and Windows VMs using the Log Analytics agent.

In the Azure portal, click All Services and filter for Log Analytics. Select Log Analytics.

Find Log Analytics

From the list of Log Analytics workspaces, select the workspace you created earlier.

From the left-hand menu, under Workspace Data Sources, select Virtual Machines.

Find Virtual Machines

From the list of virtual machines, select the virtual machine you wish to install the agent on. Notice that the OMS connection status for the VM indicates that it is Not connected.

Log Analytics Connection Status

In the details pane for your virtual machine, Select Connect. The agent will be installed and configured for your Log Analytics workspace. Please note, this process may take a few minutes to complete.

Connect Log Analytics

After the agent has been installed and connected, the OMS connection status will be updated to This workspace.

Log Analytics Connected

Step 3: Collect performance data

In the Azure portal, click All Services and filter for Log Analytics. Select Log Analytics.

Find Log Analytics

From the list of Log Analytics workspaces, select the workspace you created earlier.

From the left-hand menu, under Settings, select Advanced Settings.

Find Advanced Settings

Select Data, and then select Windows Performance Counters.

Enable the following performance counters, by typing in their name and then clicking the plus sign +:

  • LogicalDisk(*)\% Free Space
  • LogicalDisk(*)\Free Megabytes
  • Memory(*)\% Committed Bytes In Use
  • Memory(*)\Available Mbytes
  • Processor(_Total)\% Processor Time
  • System(*)\Processor Queue Length
  • System(*)\System Up Time

After enabling the required performance counters, click Save to save the configuration.

Windows Performance Counters

Then select the Windows Event Logs tab.

Enable the following data sources, by typing in their name and then clicking the plus sign +:

  • System
  • Application

Make sure all checkboxes under ERROR, WARNING and INFORMATION are ticked as shown.

Windows Data Sources

Finally, select the Storage Account Logs option under your workspace, and add the storage account related to your Virtual Machine.

Storage Account Logs

Verify Log Analytics Agent is running correctly (optional)

To verify the agent is connected and operating correctly, run the following command on your Azure VM.

/opt/microsoft/omsagent/bin/omsadmin.sh -l

It should return a status similar to:

Primary Workspace: <workspaceId> Status: Onboarded(OMSAgent Running)

If the Agent is not connected to a workspace, connect it to your chosen workspace using the following command.

/opt/microsoft/omsagent/bin/omsadmin.sh -w <workspace id> -s <shared key> [-d <top level domain>]

If the agent is connected but not running, restart the agent using the following command.

sudo /opt/microsoft/omsagent/bin/service_control restart

Finally, verify the agent is operating correcly by running the following command again.

/opt/microsoft/omsagent/bin/omsadmin.sh -l

Usage Instructions

To use this Host Template you will need to provide access to the subscription you wish to monitor

Navigate to the Subscriptions section and select your Subscription.

In the Subscription to be monitored, click Access Control (IAM).

Then click the Add button, select the required role and select the application, once for each of the following roles: * Reader

Add Subscription to Application

Add Subscription to Application

Repeat these steps for each subscription you wish to monitor.



Step 1: Add this Host Template

Add the Cloud - Azure - Windows VMs Host Template to your Opsview Monitor host. If the resource you're monitoring has no hostname or public IP, then open the Advanced settings pane and change Host Check Command to Always assumed to be UP.

For more information, refer to Opsview Knowledge Center - Adding Host Templates to Hosts.



Step 2: Add and configure variables required for this Host Template

The Service Checks in this Host Template use the following variables, and they will be added to your Opsview Monitor instance when you import the Opspack:

AZURE_CREDENTIALS

The Value is not used and therefore can be set to anything. Override the arguments with your Azure Credentials.

| Parameter | Position in Variable | Name | Description | |:---------:|:--------------------:|:-----|:------------| | --subscription-id | Arg1 | Subscription ID | The Subscription ID of your Azure Subscription | | --client-id | Arg2 | Client ID | The Client ID of your Azure Subscription | | --secret-key | Arg3 | Secret Key | The Secret Key of your Azure Subscription | | --tenant-id | Arg4 | Tenant ID | The Tenant ID of your Azure Subscription |

AZURE_RESOURCE_DETAILS

The Value is not used and therefore can be set to anything. Override the arguments with your Azure Resource Details.

| Parameter | Position in Variable | Name | Description | |:---------:|:--------------------:|:-----|:------------| | --resource-group | Arg1 | Resource Group | Name of the Azure resource group to be monitored | | --resource-name | Arg2 | Resource Name | Name of the Azure resource to be monitored |

AZURE_LOG_ANALYTICS_DETAILS

The Value is not used and therefore can be set to anything. Override the arguments with your Log Analytics Details.

Parameter Position in Variable Name Description
--workspace-id Arg1 Workspace ID The Workspace ID for Log Analytics
--log-timespan Arg2 Log Query Timespan (Minutes) The Timespan for counting VM Restart and Shutdown events, in minutes


For more information, refer to Opsview Knowledge Center - Adding Variables to Hosts.

For mode-specific help, run the plugin with the -h -m <mode> flags. This will list the required and optional Variable Arguments for that mode. The appropriate mode for each Service Check is listed here:

Service Check Name Mode
Azure - Windows VM - Memory Az.Windows.VM.Memory
Azure - Windows VM - Processor Time Az.Windows.VM.Processor.Time
Azure - Windows VM - Processor Queue Length Az.Windows.VM.Processor.Queue.Length
Azure - Windows VM - Logical Disk Space Az.Windows.VM.Logical.Disk.Space
Azure - Windows VM - System Uptime Az.Windows.VM.System.Uptime
Azure - Windows VM - Heartbeat Az.Windows.VM.Heartbeat
Azure - Windows VM - Restarts Az.Windows.VM.Restarts
Azure - Windows VM - Shutdowns Az.Windows.VM.Shutdowns



Step 3: Apply changes and the system will now be monitored

View Output

v1.0-opsview-6

ODI-3806 Cloud Azure Opspack

Initial release for Cloud Azure Opspack