你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzNetworkWatcherConnectionMonitorObject
创建连接监视器 V2 对象。
语法
New-AzNetworkWatcherConnectionMonitorObject
-NetworkWatcher <PSNetworkWatcher>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitorObject
-NetworkWatcherName <String>
-ResourceGroupName <String>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzNetworkWatcherConnectionMonitorObject
-Location <String>
-Name <String>
[-TestGroup <PSNetworkWatcherConnectionMonitorTestGroupObject[]>]
[-Output <PSNetworkWatcherConnectionMonitorOutputObject[]>]
[-Note <String>]
[-Tag <Hashtable>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzNetworkWatcherConnectionMonitorObject cmdlet 创建连接监视器 V2 对象。
示例
示例 1
$cmtest = New-AzNetworkWatcherConnectionMonitorObject -Location westcentralus -Name cmV2test -TestGroup $testGroup1, $testGroup2 -Tag @{"name" = "value"}
$cmtest
NetworkWatcherName : NetworkWatcher_westcentralus
ResourceGroupName : NetworkWatcherRG
Name : cmV2test
TestGroups : [
{
"Name": "testGroup1",
"Disable": false,
"TestConfigurations": [
{
"Name": "tcpTC",
"TestFrequencySec": 60,
"ProtocolConfiguration": {
"Port": 80,
"DisableTraceRoute": false
},
"SuccessThreshold": {
"ChecksFailedPercent": 20,
"RoundTripTimeMs": 5
}
},
{
"Name": "icmpTC",
"TestFrequencySec": 30,
"PreferredIPVersion": "IPv4",
"ProtocolConfiguration": {
"DisableTraceRoute": true
}
}
],
"Sources": [
{
"Name": "MultiTierApp0(IrinaRGWestcentralus)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/RGW
estcentralus/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"
},
{
"Name": "NPM-CommonEUS(er-lab)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/er-lab/p
roviders/Microsoft.OperationalInsights/workspaces/NPM-CommonEUS",
"Filter": {
"Type": "Include",
"Items": [
{
"Type": "AgentAddress",
"Address": "SEA-Cust50-VM01"
},
{
"Type": "AgentAddress",
"Address": "WIN-P0HGNDO2S1B"
}
]
}
}
],
"Destinations": [
{
"Name": "bingEndpoint",
"Address": "bing.com"
},
{
"Name": "googleEndpoint",
"Address": "google.com"
}
]
},
{
"Name": "testGroup2",
"Disable": false,
"TestConfigurations": [
{
"Name": "httpTC",
"TestFrequencySec": 120,
"ProtocolConfiguration": {
"Port": 443,
"Method": "GET",
"RequestHeaders": [
{
"Name": "Allow",
"Value": "GET"
}
],
"ValidStatusCodeRanges": [
"2xx",
"300-308"
],
"PreferHTTPS": true
},
"SuccessThreshold": {
"ChecksFailedPercent": 20,
"RoundTripTimeMs": 30
}
}
],
"Sources": [
{
"Name": "MultiTierApp0(IrinaRGWestcentralus)",
"ResourceId": "/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/IrinaRGW
estcentralus/providers/Microsoft.Compute/virtualMachines/MultiTierApp0"
}
],
"Destinations": [
{
"Name": "googleEndpoint",
"Address": "google.com"
}
]
}
]
Outputs : null
Notes :
Tags : {
"name": "value"
}
参数
-Confirm
提示你在运行 cmdlet 之前进行确认。
类型: | SwitchParameter |
别名: | cf |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
网络观察程序的位置。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Name
连接监视器名称。
类型: | String |
别名: | ConnectionMonitorName |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NetworkWatcher
网络观察程序资源。
类型: | PSNetworkWatcher |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NetworkWatcherName
网络观察程序的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Note
与连接监视器关联的注释。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Output
描述连接监视器输出目标。
类型: | PSNetworkWatcherConnectionMonitorOutputObject[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
网络观察程序资源组的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Tag
表示资源标记的哈希表。
类型: | Hashtable |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-TestGroup
测试组的列表。
类型: | PSNetworkWatcherConnectionMonitorTestGroupObject[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-WhatIf
显示运行该 cmdlet 时会发生什么情况。 cmdlet 未运行。
类型: | SwitchParameter |
别名: | wi |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
None