You are here

Integrations

Azure - Linux VMs

Requires Opsview Monitor 6.x
check_circle
Opsview Supported

404: Not Found

Cloud - Azure - Linux VMs Opspack

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

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

How does this Opspack differ from OS - Unix Base?

Using OS - Unix Base requires the installation of an Opsview Agent for Linux 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 - Unix 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 Opspack offer above Azure - Virtual Machines?

The Azure - Virtual Machines Opspack 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 Opspack complements Azure - Virtual Machines by offering extended metrics including memory utilization, memory swap space utilization, processor time, 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).

What You Can Monitor

This Opspack allows you to monitor the performance metrics for Linux virtual machines - in particular memory utilization, memory swap space utilization, processor time, disk space, heartbeats, and restart/shutdown history.

Service Checks

Host Template Service Check Description
Cloud - Azure - Linux VMs Azure - Linux VM - Memory The percentage of used memory and the available memory in bytes [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Memory Swap Space The percentage of swap space used [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Processor Time The percentage of processor time [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Processor Privileged Time The percentage of processor privileged time [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Logical Disk Space The percentage of used logical disk space [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - System Uptime The system uptime [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Heartbeat The time between the last two heartbeats [Default Timespan = 5mins, Granularity = 5mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Restarts The number of restarts, and information on the user and command invoke history [Default Timespan = 1440mins, Granularity = 1440mins]
Cloud - Azure - Linux VMs Azure - Linux VM - Shutdowns The number of shutdowns, and information on the user and command invoke history [Default Timespan = 1440mins, Granularity = 1440mins]

Prerequisites

  • Ensure your Opsview Monitor version is newer than 07 September 2018. Check Opsview Release Notes for the latest version of Opsview Monitor.

Known Issues

Sometimes the Azure Log Analytics agent may stop reporting metrics (see: https://github.com/Microsoft/OMS-Agent-for-Linux/issues/766 ), and therefore cause Opsview to return a Warning stating 'The Azure Server returned no results'.

Follow the steps inside the Verify Log Analytics Agent is running correctly section to check if your agent is working correctly and to troubleshoot it.

Setup Azure for Monitoring

To monitor your Azure environment, you need to configure it for monitoring. This requires Administrator access on Azure.

You need to retrieve the following credentials, which will allow Opsview Monitor access to the metrics for your Azure VM:

  • Subscription ID
  • Tenant/Directory ID
  • Client/Application ID
  • Secret Key

Follow the below steps to retrieve this information.

Step 1: Find Subscription ID

The Subscription ID can be found in the Subscriptions section under the All services section from the Azure dashboard.

Find Azure Subscription ID

Find Azure Subscription ID

Step 2 : Find the Tenant/Directory ID

The Tenant/Directory ID can be found in the Azure Active Directory under the Properties section from the Azure dashboard.

Find Azure Tenant/Directory ID

Step 3: Find the Client/Application ID for your application

You need to create and register your application if you haven't already. Use the following documentation from Microsoft: Create an Azure Active Directory application.

The Client/Application ID can be found in Azure Active Directory under the App registrations section from the Azure dashboard.

Find Azure Client/Application ID

Step 4: Generate the Secret Key for your application

You will need to create a Secret Key for your application, once this has been created its value will be hidden so save the value during creation.

To create the Secret Key, select your application from the list, select the Settings within your application and then select the Keys option.

There you can create a new key by adding the description and expiration period and the value will be generated.

Create Secret Key

Step 5: Provide access to the subscription you wish to monitor

Navigate to the Subscriptions section and select the Subscription you selected before.

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

If you are running more than one subscription these steps will need to be done for each one you wish to monitor.

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 Linux Performance Counters.

Click on the checkbox marked Apply below configuration to my machines.

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

  • Logical Disk(*)\Free Megabytes
  • Logical Disk(*)\% Used Space
  • Memory(*)\Available MBytes Memory
  • Memory(*)\% Used Memory
  • Memory(*)\% Used Swap Space
  • Processor(*)\% Processor Time
  • Processor(*)\% Privileged Time
  • System(*)\Uptime

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

Linux Performance Counters

Then select the Syslog tab and click the checkbox marked Apply below configuration to my machines.

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

  • syslog
  • kern
  • authpriv
  • daemon

Make sure all checkboxes under EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG are ticked as shown.

Linux 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

Setup and Configuration

To configure and utilize this Opspack, you simply need to add the 'Cloud - Azure - Linux VMs' Opspack to your Opsview Monitor system.

Step 1: Import the Opspack

Download the cloud-azure-linux-vms.opspack file from the Releases section of this repository. Navigate to Host Template Settings inside Opsview Monitor and select Import Opspack in the top left corner.

Add Variables

Then click Browse and select the cloud-azure-linux-vms.opspack file. Click Upload and then click Import when the file is uploaded. You may see a 'CONFLICT' warning message after uploading - this is because all 'Cloud - Azure' Opspacks utilize the same variable (AZURE_CREDENTIALS) for authorizing access to your resources. Just click Overwrite and the Opspack should import successfully.

Add Variables

Step 2: Add the host template

Add the relevant host template (as listed in the Service Checks table above). If this is a resource that is applicable for a host check (has a valid hostname or IP) then you can fill in the Primary Hostname/IP field with this, and then open the Advanced section at the bottom and change the Host Check Command type to TCP Port 80 (HTTP). If the resource has no hostname or public IP, then change Host Check Command to Always assumed to be UP.

Add Host Template

Step 3: Add and configure variables required for this host

Add 'AZURE_CREDENTIALS' to the host, then override the Subscription ID, Client ID, Secret Key and Tenant ID to match the values retrieved earlier.

Add Variables

Depending on your host template, you will require different additional variables declared as specified below:

Host Template Variables Required
Cloud - Azure - Linux VMs AZURE_RESOURCE_DETAILS, AZURE_LOG_ANALYTICS_DETAILS

These can be filled out as follows:

AZURE_RESOURCE_DETAILS:

Add Variables

AZURE_LOG_ANALYTICS_DETAILS:

Add Variables

Step 4: Reload and the system will now be monitored

View Output

v2.1-opsview-6

ODI-1747 Fixes and Improvements to Authentication Process

Improvements to Azure authentication error handling

v2.0-opsview-6

ODI-840 Initial Release of Azure VM Opspacks for Opsview Monitor 6.0

Initial release of Opspack to work with Opsview Monitor 6.0