az monitor data-collection rule performance-counter

注意

此參考是 Azure CLI 的 monitor-control-service 擴充功能的一部分(2.55.0 版或更高版本)。 擴充功能會在您第一次執行 az monitor data-collection rule performance-counter 命令時自動安裝。 深入了解擴充功能。

管理記錄性能計數器數據源。

命令

名稱 Description 類型 狀態
az monitor data-collection rule performance-counter add

新增記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter delete

刪除記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter list

列出記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter show

顯示記錄性能計數器數據源。

副檔名 GA
az monitor data-collection rule performance-counter update

更新記錄性能計數器數據源。

副檔名 GA

az monitor data-collection rule performance-counter add

新增記錄性能計數器數據源。

az monitor data-collection rule performance-counter add --counter-specifiers
                                                        --name
                                                        --resource-group
                                                        --rule-name
                                                        --sampling-frequency
                                                        --streams {Microsoft-InsightsMetrics, Microsoft-Perf}

範例

新增記錄性能計數器數據源

az monitor data-collection rule performance-counter add --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters" --streams "Microsoft-Perf" --counter-specifiers "\\Process(_Total)\\Thread Count" "\\LogicalDisk(_Total)\\Free Megabytes" --sampling-frequency 30

必要參數

--counter-specifiers

您想要收集之性能計數器的規範名稱清單。使用通配符 \ 收集所有實例的計數器。 若要在 Windows 上取得性能計數器清單,請執行命令 『typeperf』。

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-name

數據收集規則的名稱。 名稱不區分大小寫。

--sampling-frequency

連續計數器度量之間的秒數(樣本)。

--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。

接受的值: Microsoft-InsightsMetrics, Microsoft-Perf
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule performance-counter delete

刪除記錄性能計數器數據源。

az monitor data-collection rule performance-counter delete --name
                                                           --resource-group
                                                           --rule-name

範例

刪除記錄性能計數器數據源

az monitor data-collection rule performance-counter delete --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters"

必要參數

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-name

數據收集規則的名稱。 名稱不區分大小寫。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule performance-counter list

列出記錄性能計數器數據源。

az monitor data-collection rule performance-counter list --resource-group
                                                         --rule-name

範例

列出記錄性能計數器數據源

az monitor data-collection rule performance-counter list --rule-name "myCollectionRule" --resource-group "myResourceGroup"

必要參數

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-name

數據收集規則的名稱。 名稱不區分大小寫。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule performance-counter show

顯示記錄性能計數器數據源。

az monitor data-collection rule performance-counter show --name
                                                         --resource-group
                                                         --rule-name

範例

顯示記錄性能計數器數據源

az monitor data-collection rule performance-counter show --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "appTeamExtraCounters"

必要參數

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-name

數據收集規則的名稱。 名稱不區分大小寫。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor data-collection rule performance-counter update

更新記錄性能計數器數據源。

az monitor data-collection rule performance-counter update --name
                                                           --resource-group
                                                           --rule-name
                                                           [--counter-specifiers]
                                                           [--sampling-frequency]
                                                           [--streams {Microsoft-InsightsMetrics, Microsoft-Perf}]

範例

更新記錄性能計數器數據源

az monitor data-collection rule performance-counter update --rule-name "myCollectionRule" --resource-group "myResourceGroup" --name "team2ExtraCounters"

必要參數

--name -n

數據源的易記名稱。 此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rule-name

數據收集規則的名稱。 名稱不區分大小寫。

選擇性參數

--counter-specifiers

您想要收集之性能計數器的規範名稱清單。使用通配符 \ 收集所有實例的計數器。 若要在 Windows 上取得性能計數器清單,請執行命令 『typeperf』。

--sampling-frequency

連續計數器度量之間的秒數(樣本)。

--streams

此數據源將傳送至的數據流清單。 數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。

接受的值: Microsoft-InsightsMetrics, Microsoft-Perf
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。