---
title: "Host Template: Cloud - Azure - Network Watcher - VM Connectivity"
description: ""
url: "https://docs.itrsgroup.com/docs/opsview/6.11.7/opspacks/cloud-azure-opspack/cloud-azure-network-watcher-vm-connectivity-host-template/index.html"
---## Overview

Azure Network Watchers allow you to monitor, diagnose, view metrics, and enable or disable logs for resources in an Azure virtual network. You can monitor communication between virtual machines and endpoints, and view the relationships between resources in a virtual network. Additionally, you can capture packets, troubleshoot and diagnose problems inside a virtual network.

This Host Template allows you to monitor the connectivity between two VMs using a Network Watcher.

This Host Template includes the following Service Checks:

| Service&nbsp;Check&nbsp;Name | Description | Default&nbsp;Thresholds (Metric:&nbsp;Warning,&nbsp;Critical) | UOM |
|:-----------------------------|:------------|:------------------------------------------------:|:---:|
| Azure - Network Watcher - VM Connectivity | Check the status of TCP connection from a source VM to a target VM in Azure via a Network Watcher
[Default Timespan = 5mins, Default Check Interval = 5mins] | N/A | NA |


**Note**


The "Default Timespan" given for these Service Checks refers to the time period we use when retrieving metrics from Azure.




**Note**


See details about [Monitoring Plugin thresholds here](https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT).



## Prerequisites for monitoring

### Provide Subscription Access

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**
- **Network Contributor**
- **Storage Account Contributor**

![Add Subscription to Application](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-add_subscription_1.png)

![Add Subscription to Application](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-add_subscription_2.png)

Repeat these steps for each subscription you wish to monitor.

## Usage Instructions

Please review the overall [Cloud - Azure Opspack](https://docs.itrsgroup.com/docs/opsview/6.11.7/opspacks/cloud-azure-opspack/cloud-azure-opspack/index.html) documentation for details on prerequisites, known issues, and other necessary configurations that apply to all Host Templates in the Opspack.

### Add this Host Template

Add the **Cloud - Azure - Network Watcher - VM Connectivity** 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**.


**Note**


For more information, refer to the documentation on [Adding Host Templates to Hosts](https://docs.itrsgroup.com/docs/opsview/6.11.7/host/index.html#host-templates).



### Add and configure Variables

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

- [**AZURE_CREDENTIALS**](#azure_credentials)
- [**AZURE_NETWORK_WATCHER_DETAILS**](#azure_network_watcher_details)
- [**AZURE_CONNECTIVITY_SOURCE_DETAILS**](#azure_connectivity_source_details)
- [**AZURE_CONNECTIVITY_TARGET_DETAILS**](#azure_connectivity_target_details)


**Note**


For more information, refer to the documentation on [Adding Variables to Hosts](https://docs.itrsgroup.com/docs/opsview/6.11.7/adding-a-new-variable/index.html#adding-a-variable-to-a-host).



### Apply Changes

Apply Changes and the system will now be monitored:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-output-cloud-azure-network-watcher-vm-connectivity.png)

## Available Variables

### AZURE_CREDENTIALS

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

| Plugin&nbsp;Parameter | Position&nbsp;in Variable | Name | Description |
|:---------------------:|:-------------------------:|:-----|:------------|
| N/A (Opsview UI Only) | Value | Credentials | The credentials for your Azure Subscription |
| `--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_NETWORK_WATCHER_DETAILS

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

Note that your Network Watchers will by default be located in the 'NetworkWatcherRG' Resource Group:

![NetworkWatcherRG](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-network_watcher_resource_group.png)

When Network Watchers are created, by default they are called 'NetworkWatcher_{region}' e.g. 'NetworkWatcher_uksouth'.


**Note**


For more information, see [Microsoft Azure - Create a Network Watcher](https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-create#create-a-network-watcher-in-the-portal).



![Network Watchers](https://docscdn.itrsgroup.com/opsview/images/opspacks-cloud-azure-network_watchers.png)

Your Network Watcher names and Resource Group could differ if not created via the Portal, or moved manually, so ensure the arguments you provide are correct for the Network Watcher you want to monitor.

| Plugin&nbsp;Parameter | Position&nbsp;in Variable | Name | Description |
|:---------------------:|:-------------------------:|:-----|:------------|
| N/A (Opsview UI Only) | Value | Network Watcher Details | The details of your Azure Network Watcher |
| `--network-watcher-group` | Arg1 | Network Watcher Resource Group | Name of the Azure Resource Group containing the Network Watcher to be monitored |
| `--network-watcher-name` | Arg2 | Network Watcher Resource Name | Name of the Azure Network Watcher to be monitored |
| `--max-display-number` | Arg3 | Maximum Display Number | The maximum number of list items to display for Network Watcher Service Checks |

### AZURE_CONNECTIVITY_SOURCE_DETAILS

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

| Plugin&nbsp;Parameter | Position&nbsp;in Variable | Name | Description |
|:---------------------:|:-------------------------:|:-----|:------------|
| N/A (Opsview UI Only) | Value | Connectivity Source Details | The details of your Azure Connectivity Source |
| `--conn-source-group` | Arg1 | Connectivity Source Resource Group | Name of the Azure Connectivity Source resource group to be monitored |
| `--conn-source-name` | Arg2 | Connectivity Source Resource Name | Name of the Azure Connectivity Source resource to be monitored |

### AZURE_CONNECTIVITY_TARGET_DETAILS

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

| Plugin&nbsp;Parameter | Position&nbsp;in Variable | Name | Description |
|:---------------------:|:-------------------------:|:-----|:------------|
| N/A (Opsview UI Only) | Value | Connectivity Target Details | The details of your Azure Connectivity Target |
| `--conn-target-group` | Arg1 | Connectivity Target Resource Group | Name of the Azure Connectivity Target resource group to be monitored |
| `--conn-target-name` | Arg2 | Connectivity Target Resource Name | Name of the Azure Connectivity Target resource to be monitored |
| `--conn-target-port` | Arg3 | Connectivity Target Port | The Azure Connectivity Target port |

## Plugin help

Plugin: `check_azure`


**Secure Args**


This plugin uses the [Secure Args](https://docs.itrsgroup.com/docs/opsview/6.11.7/configuration/secure-arguments/index.html) feature for argument passing.



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&nbsp;Check&nbsp;Name | Mode |
|:-----------------------------|:-----|
| Azure - Network Watcher - VM Connectivity | `Az.Network.Watcher.VM.Connectivity` |


