

# Working with monitors and probes in Network Synthetic Monitor
Working with monitors and probes

To get started, create a monitor with probes in Network Synthetic Monitor to measure network performance over a specified aggregation period. Then, you can update a monitor to make desired changes, for example, to change the aggregation period, deactivate or activate probes, or add or remove tags.

The following sections provide step-by-step instructions for completing these tasks for your monitors and probes by using the Amazon CloudWatch console. You can also make changes to your monitor by using the Amazon Command Line Interface.

**Topics**
+ [

# Create a monitor
](getting-started-nw.md)
+ [

# Edit a monitor
](nw-monitor-edit.md)
+ [

# Delete a monitor
](nw-monitor-delete.md)
+ [

# Activate or deactivate a probe
](nw-monitor-probe-status.md)
+ [

# Add a probe to a monitor
](nw-monitor-add-probe.md)
+ [

# Edit a probe
](nw-monitor-probe-edit.md)
+ [

# Delete a probe
](nw-monitor-probe-delete.md)
+ [

# Tag or untag resources
](nw-monitor-tags-cli.md)

# Create a monitor
Create a monitor

The following sections describe how to create a monitor in Network Synthetic Monitor, including the required probes. When you create a monitor, you specify probes by choosing source subnets, and then adding up to four destinations for each one. Each source-destination pair is a probe.

You can make changes to a monitor after you create it, for example, to add, remove, or deactivate probes. For more information, see [Working with monitors and probes in Network Synthetic Monitor](nw-monitor-working-with.md).

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

The following procedures provide step-by-step instructions for how to create a monitor by using the Amazon CloudWatch console. 
+ [Define monitor details](#NWDefineDetails)
+ [Choose sources and destinations](#NWSourceDestination)
+ [Confirm probes](#NWConfirmProbes)
+ [Review and create monitor](#NWReviewCreate)

**Important**  
These steps are designed to be completed all at once. You can't save in-process work to continue later.

## Define monitor details


The first step to create a monitor is to define the basic details, by giving the monitor a name and defining the aggregation period. Optionally, you can also add tags.

**To define monitor details**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. Choose **Create monitor**.

1. For **Monitor name**, enter a name for the monitor.

1. For **Aggregation period**, choose how often you want to send metrics to CloudWatch: **30 seconds** or **60 seconds**.
**Note**  
A shorter aggregation period provides faster detection of network issues. However, the aggregation period that you choose can affect your billing costs. For more information about pricing, see the [Amazon CloudWatch pricing](https://www.amazonaws.cn//cloudwatch/pricing/) page.

1. (Optional) For **Tags**, add **Key** and **Value** pairs to help identify this resource, so that you can search or filter on specific information.

   1. Choose **Add new tag**. 

   1. Enter a **Key** name and associated **Value**. 

   1. Choose **Add new tag** to add the new tag.

      You can add multiple tags by choosing **Add new tag**, or you can remove a tag by choosing **Remove**.

   1. If you want to associate your tags with the probes for the monitor, keep **Add tags to probes created by monitor** selected. This adds the tags to the monitor probes, which can be helpful for tag-based authentication or metering.

1. Choose **Next**. On the next page, you'll specify sources and destinations, to create probes for the monitor.

## Choose sources and destinations


For each monitor in Network Synthetic Monitor, you specify one or more probes, which are a combination of an Amazon source and a destination.
+ A source for a probe is a VPC and associated subnets (or just a VPC subnet) in the Regions where your network operates.
+ A destination is the combination of on-premises IP addresses, network protocols, ports, and network packet size. 

**Important**  
These steps are designed to be completed all at once. You can't save in-process work to continue later.

**To choose sources and destinations**

1. Prerequisite: [Define monitor details](#define-details-nw).

1. Under **Amazon** **network source**, choose one or more subnets to include in the monitor. To choose all subnets within a VPC, choose the VPC. Or, choose specific subnets within a VPC. The subnets that you choose are the monitor sources.

1. For **Destination 1**, enter a destination IP address of the on-premises network. IPv4 and IPv6 addresses are both supported. 

1. Choose **Advanced settings**.

1. For **Protocol**, choose the network protocol for the on-premises destination. The protocol can be either **ICMP** or **TCP**.

1. If you choose **TCP**, enter the following information:

   1. Enter the **Port** that your network uses to connect. The port must be a number from **1** to **65535**.

   1. Enter the **Packet size**. This is the size, in bytes, of each packet that's sent on the probe, between the source and destination. Packet size must be a number from **56** to **8500**.

1. Choose **Add destination** to add another on-premises destination to the monitor. Repeat these steps for each destination that you want to add.

1. When you're finished adding sources and destinations, choose **Next** to confirm the probes for the monitor.

## Confirm probes


On the **Confirm probes** page, review all the probes that will be created for the monitor, to make sure that they're the correct set of sources and destinations.

The **Confirm probes** page shows all the possible combinations of the sources and destinations for the probe specifications that you provided in the previous step. For example, if you have six source subnets and four destination IP addresses, there are 24 possible probe combinations, so 24 probes will be created. 

**Important**  
These steps are intended to be completed in one session. You can't save in-process work to continue later.
 The **Confirm probes** page does not indicate whether a probe is valid. We recommend that you review this page carefully, and then delete any probes that aren't valid. You might be charged for probes that aren't valid if you don't remove them.

**To confirm monitor probes**

1. Prerequisite: [Choose sources and destinations](#source-destination-nw).

1. On the **Confirm probes** page, review the list of source and destination probe combinations.

1. Choose any probes that you want to remove from the monitor, and then choose **Remove**.
**Note**  
You are not prompted to confirm deleting a probe. If you delete a probe and want to restore it, you must set it up again. You can add a probe to an existing monitor by following the steps in [Add a probe to a monitor](nw-monitor-add-probe.md).

1. Choose **Next**, and then review the monitor details.

## Review and create monitor


The final step is to review the details of the monitor and the probes for the monitor, and then create the monitor. You can change any information about the monitor at this point. 

When you have finished reviewing and updating any information that isn't correct, create the monitor.

As soon as you create the monitor, Network Synthetic Monitor begins tracking metrics and you'll start being charged for probes in the monitor.

**Important**  
This step is intended to be completed in one session. You can't save in-process work to continue later.
If you choose to edit a section, you must step through the process to create a monitor from the point that you make the edits. Earlier monitor creation pages maintain the information that you already entered.

**To review and create a monitor**

1. On the **Review and create probes** page, choose **Edit** for any section where you want to make changes.

1. Make changes in that section, and then choose **Next**.

1. When you're finished making edits, choose **Create monitor**.

   The Network Synthetic Monitor page displays the current state of monitor creation in the **Monitors** section. When Network Synthetic Monitor is still creating the monitor, the **State** is **Pending**. When the **State** changes to **Active**, you can view CloudWatch metrics in the monitor dashboard.

   For information on working with the monitor dashboard, see [Network Synthetic Monitor dashboards](nw-monitor-dashboards.md).

**Note**  
It can take several minutes for a newly-added monitor to begin collecting network metrics.

# Edit a monitor


You can edit information for a Network Synthetic Monitor, including change the name, setting a new aggregation period, or adding or removing tags. Changing a monitor's information does not change any of its associated probes.

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To edit a monitor using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. In the **Monitors** section, choose the monitor that you want to edit.

1. On the monitor dashboard page, choose **Edit**.

1. For the **Monitor name**, enter the new name for the monitor.

1. For the **Aggregation period**, choose how often you want to send metrics to CloudWatch. Valid periods are:
   + **30 seconds**
   + **60 seconds**
**Note**  
A shorter aggregation period provides faster detection of network issues. However, the aggregation period that you choose can affect your billing costs. For more information about pricing, see the [Amazon CloudWatch pricing](https://www.amazonaws.cn//cloudwatch/pricing/) page.

1. (Optional) In the **Tags** section, add **Key** and **Value** pairs to further help identify this resource, allowing you to search or filter on specific information. You can also just change the **Value** of any current **Key**.

   1. Choose **Add new tag**. 

   1. Enter a **Key** name and associated **Value**. 

   1. Choose **Add new tag** to add the new tag.

      You can add multiple tags by choosing **Add new tag**, or you can remove a tag by choosing **Remove**.

   1. If you want to associate your tags with the monitor, keep **Add tags to probes created by monitor** checked. This adds the tags to the monitor probes, which can be helpful if you're using tag-based authentication or metering.

1. Choose **Save changes**.

# Delete a monitor


Before you can delete a monitor in Network Synthetic Monitor, you must deactivate or delete all probes associated with the monitor, regardless of the monitor **State**. After a monitor is deleted, you are no longer be charged for probes in the monitor. Be aware that you can't restore a deleted monitor.

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To delete a monitor using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. In the **Monitors** section, choose the monitor that you want to delete.

1. Choose **Actions**, and then choose **Delete**.

1. If you have any active probes for the monitor, you're prompted to deactivate them. Choose **Deactivate probes**. 
**Note**  
You can't cancel or undo this action after you choose **Deactivate probes**. Deactivated probes, however, aren't removed from the monitor. If you like, you can reactivate them later. For more information, see [Activate or deactivate a probe](nw-monitor-probe-status.md).

1. Enter **confirm** in the confirmation field, and then choose **Delete**.

Alternatively, you can delete a monitor programmatically, for example, by using the Amazon Command Line Interface. 

**To delete a monitor by using the CLI**

1. To delete a monitor, you need the monitor name. If you don't know the name, get a list of your monitors by running the [list-monitors](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/list-monitors.html) command. Note the name of the monitor that you want to delete.

1. Verify whether the monitor contains any active probes. Use [get-monitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/get-monitor.html) with the monitor name from the previous step. This returns a list of any probes associated with that monitor.

1. If the monitor contains active probes, you must first either set the probes to inactive or delete them. 
   + To set a probe to inactive, use [update-probe](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/update-probe.html), and set the state to `INACTIVE`.
   + To delete a probe, use [delete-probe](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/delete-probe.html).

1. After the probes are set to `INACTIVE` or deleted, you can delete the monitor by running the [delete-monitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/create-probe.html) command. Inactive probes are not deleted when you delete the monitor.

# Activate or deactivate a probe


You can activate or deactivate a probe in a monitor in Network Synthetic Monitor. You might want to deactivate a probe, for example, if you aren't currently using it but might want to use it again in the future. By deactivating a probe instead of deleting it, you won't need to spend time setting it up again. You are not billed for deactivated probes. 

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To set a probe to active or inactive by using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. Choose the **Monitor details** tab. 

1. In the **Probes** section, choose the probe that you want to activate or deactivate. 

1. Choose **Actions**, and then choose **Activate** or **Deactivate**.
**Note**  
When you reactivate a probe, you begin incurring billing charges on the probe again.

# Add a probe to a monitor


You can add a probe to an existing monitor in Network Synthetic Monitor. Note that when you add probes to a monitor, your billing structure is updated to include the new probe. 

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To add a probe to a monitor using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. In the **Monitors** section, do one of the following:
   + Choose the **Name** link of the monitor that you want to add a probe to. Choose the **Monitor details** tab, and then in the **Probes** section, choose **Add probe**.
   + Choose the monitor check box, choose **Actions**, and then choose **Add probe**.

1. On the **Add probe** page, do the following:

   1.  Under **Amazon** **network source**, choose a subnet to add to the monitor. 
**Note**  
You can only add one probe at a time and up to four probes per monitor.

   1.  Enter the destination **IP address** of the on-premises network. Both IPv4 and IPv6 addresses are supported. 

   1.  Choose **Advanced settings**.

   1.  Choose the network **Protocol** for the destination. It can be either **ICMP** or **TCP**.

   1.  If the **Protocol** is **TCP**, enter the following information. Otherwise, skip to the next step: 
      + Enter the **Port** that your network uses to connect. The port must be a number from **1** to **65535**.
      + Enter the **Packet size**. This is the size, in bytes, of each packet sent along the probe between the source and destination. Packet size must be a number from **56** to **8500**.

1. (Optional) In the **Tags** section, add **Key** and **Value** pairs to further help identify this resource, allowing you to search or filter on specific information.

   1. Choose **Add new tag**. 

   1. Enter a **Key** name and associated **Value**. 

   1. Choose **Add new tag** to add the new tag.

      You can add multiple tags by choosing **Add new tag**, or you can remove any tag by choosing **Remove**.

1. Choose **Add probe**.

   While the probe is being activated, the **State** shows **Pending**. It might take several minutes for the probe to become **Active**. 

# Edit a probe


You can change any information for an existing probe, regardless of whether that probe is active or inactive.

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To edit a probe by using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

   Under **Name**, choose a monitor link to open the monitor dashboard. 

1. Choose the **Monitor details** tab. 

1. In the **Probes** section, choose the link for the probe that you want to edit.

1. On the probe details page, choose **Edit**.

1. On the **Edit *probe*** page, enter the new destination **IP address** for the probe. IPv4 and IPv6 addresses are both supported. 

1. Choose **Advanced settings**.

1. Choose a network **Protocol**, **ICMP** or **TCP**.

1.  If the **Protocol** is **TCP**, enter the following information: 
   + Enter the **Port** that your network uses to connect. The port must be a number from **1** to **65535**.
   + Enter the **Packet size**. This is the size, in bytes, of each packet sent along the probe between the source and destination. Packet size must be a number from **56** to **8500**.

1. (Optional) Add, change, or remove Tags for the probe. 

1. Choose **Save changes**.

# Delete a probe


You can delete a probe rather than deactivating it if you know that you won't need it again later. You can't recover a deleted probe; instead, you must recreate it. Billing charges end for a probe when the probe is deleted.

You can work with monitors and probes by using either the Amazon CloudWatch console or the Amazon Command Line Interface. To work with Network Synthetic Monitor programmatically, see the [Network Synthetic Monitor API Reference](https://docs.amazonaws.cn/networkmonitor/latest/APIReference/Welcome.html) and [networkmonitor](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/) in the Amazon Command Line Interface Command Reference.

**To delete a probe using the console**

1. Open the CloudWatch console at [https://console.amazonaws.cn/cloudwatch/](https://console.amazonaws.cn/cloudwatch/), and then, under **Network Monitoring**, choose **Synthetic monitors**.

1. In the **Monitors** section, under **Name**, choose a monitor link to open the monitor dashboard.

1. Choose the **Monitor details** tab.

1. Choose the monitor check box, choose **Actions**, and then choose **Delete**.

1. In the **Delete probe** dialog box, do the following:

1. Choose **Delete** to confirm that you want to delete the probe. 

   The **State** of the probe in the **Probes** section shows **Deleting**. After it's deleted, the probe is removed from the **Probes** section. 

# Tag or untag resources


You can work with resource tags in Network Synthetic Monitor, to add or remove tags.

You can update tags by updating monitors or probes in the console. Or, you can work with tags programmatically, for example, by using the Amazon Command Line Interface.

**To update monitor tags by using the CLI**
+ To list resource tags, use [list-tags-for-resources](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/list-tags-for-resources.html).
+ To tag a resource, use [tag-resource](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/tag-resource.html).
+ To untag a resource, use [untag-resource](https://docs.amazonaws.cn/cli/latest/reference/networkmonitor/untag-resource.html). 