Skip to content

Commit 13b2547

Browse files
authored
Update network-watcher-packet-capture-manage-cli.md
I added a command for showing the Network Watcher extension for a Linux VM, as the difference in naming (e.g. AzureNetworkWatcherExtension for Linux) causes confusion when referencing the name of the extension on Windows. Additionally, I may be mistaken, but I think the existing Step 1 under "Start a packet capture" is unnecessary. "az network watcher show" is invalid. Also, I changed "Start a packet capture" step 2 to retrieve the storage account with "az storage account list" instead of "azure storage account list". Finally, I changed references to 'cmdlet' to 'command' to make it more consistent for the CLI portion of the documentation.
1 parent b678538 commit 13b2547

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

articles/network-watcher/network-watcher-packet-capture-manage-cli.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This article assumes you have the following resources:
5050

5151
### Step 1
5252

53-
Run the `az vm extension set` cmdlet to install the packet capture agent on the guest virtual machine.
53+
Run the `az vm extension set` command to install the packet capture agent on the guest virtual machine.
5454

5555
For Windows virtual machines:
5656

@@ -66,12 +66,18 @@ az vm extension set --resource-group resourceGroupName --vm-name virtualMachineN
6666

6767
### Step 2
6868

69-
To ensure that the agent is installed, run the `vm extension show` cmdlet and pass it the resource group and virtual machine name. Check the resulting list to ensure the agent is installed.
69+
To ensure that the agent is installed, run the `vm extension show` command and pass it the resource group and virtual machine name. Check the resulting list to ensure the agent is installed.
7070

71+
For Windows virtual machines:
7172
```azurecli
7273
az vm extension show --resource-group resourceGroupName --vm-name virtualMachineName --name NetworkWatcherAgentWindows
7374
```
7475

76+
For Linux virtual machines:
77+
```azurecli
78+
az vm extension show --resource-group resourceGroupName --vm-name virtualMachineName --name AzureNetworkWatcherExtension
79+
```
80+
7581
The following sample is an example of the response from running `az vm extension show`
7682

7783
```json
@@ -100,29 +106,21 @@ Once the preceding steps are complete, the packet capture agent is installed on
100106

101107
### Step 1
102108

103-
The next step is to retrieve the Network Watcher instance. TThe name of the Network Watcher is passed to the `az network watcher show` cmdlet in step 4.
104-
105-
```azurecli
106-
az network watcher show --resource-group resourceGroup --name networkWatcherName
107-
```
108-
109-
### Step 2
110-
111109
Retrieve a storage account. This storage account is used to store the packet capture file.
112110

113111
```azurecli
114-
azure storage account list
112+
az storage account list
115113
```
116114

117-
### Step 3
115+
### Step 2
118116

119117
Filters can be used to limit the data that is stored by the packet capture. The following example sets up a packet capture with several filters. The first three filters collect outgoing TCP traffic only from local IP 10.0.0.3 to destination ports 20, 80 and 443. The last filter collects only UDP traffic.
120118

121119
```azurecli
122120
az network watcher packet-capture create --resource-group {resourceGroupName} --vm {vmName} --name packetCaptureName --storage-account {storageAccountName} --filters "[{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"20\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"80\"},{\"protocol\":\"TCP\", \"remoteIPAddress\":\"1.1.1.1-255.255.255\",\"localIPAddress\":\"10.0.0.3\", \"remotePort\":\"443\"},{\"protocol\":\"UDP\"}]"
123121
```
124122

125-
The following example is the expected output from running the `az network watcher packet-capture create` cmdlet.
123+
The following example is the expected output from running the `az network watcher packet-capture create` command.
126124

127125
```json
128126
{
@@ -177,13 +175,13 @@ roviders/microsoft.compute/virtualmachines/{vmName}/2017/05/25/packetcapture_16_
177175

178176
## Get a packet capture
179177

180-
Running the `az network watcher packet-capture show-status` cmdlet, retrieves the status of a currently running, or completed packet capture.
178+
Running the `az network watcher packet-capture show-status` command, retrieves the status of a currently running, or completed packet capture.
181179

182180
```azurecli
183181
az network watcher packet-capture show-status --name packetCaptureName --location {networkWatcherLocation}
184182
```
185183

186-
The following example is the output from the `az network watcher packet-capture show-status` cmdlet. The following example is when the capture is Stopped, with a StopReason of TimeExceeded.
184+
The following example is the output from the `az network watcher packet-capture show-status` command. The following example is when the capture is Stopped, with a StopReason of TimeExceeded.
187185

188186
```
189187
{
@@ -202,14 +200,14 @@ cketCaptures/packetCaptureName",
202200

203201
## Stop a packet capture
204202

205-
By running the `az network watcher packet-capture stop` cmdlet, if a capture session is in progress it is stopped.
203+
By running the `az network watcher packet-capture stop` command, if a capture session is in progress it is stopped.
206204

207205
```azurecli
208206
az network watcher packet-capture stop --name packetCaptureName --location westcentralus
209207
```
210208

211209
> [!NOTE]
212-
> The cmdlet returns no response when ran on a currently running capture session or an existing session that has already stopped.
210+
> The command returns no response when ran on a currently running capture session or an existing session that has already stopped.
213211
214212
## Delete a packet capture
215213

0 commit comments

Comments
 (0)