Skip to content

Commit 641fe16

Browse files
committed
freshness184
1 parent 4851e01 commit 641fe16

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

articles/hdinsight/hdinsight-hadoop-oms-log-analytics-tutorial.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ If you don't have an Azure subscription, [create a free account](https://azure.m
3434

3535
For the instructions on how to create an HDInsight cluster, see [Get started with Azure HDInsight](hadoop/apache-hadoop-linux-tutorial-get-started.md).
3636

37-
* Azure PowerShell Az module. See [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az).
37+
* Azure PowerShell Az module. See [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az). Ensure you have the latest version. If necessary, run `Update-Module -Name Az`.
3838

3939
> [!NOTE]
4040
> It is recommended to place both the HDInsight cluster and the Log Analytics workspace in the same region for better performance. Azure Monitor logs is not available in all Azure regions.
@@ -57,7 +57,7 @@ In this section, you configure an existing HDInsight Hadoop cluster to use an Az
5757

5858
## Enable Azure Monitor logs by using Azure PowerShell
5959

60-
You can enable Azure Monitor logs using the Azure PowerShell Az module [Enable-AzHDInsightOperationsManagementSuite](https://docs.microsoft.com/powershell/module/az.hdinsight/enable-azhdinsightoperationsmanagementsuite) cmdlet.
60+
You can enable Azure Monitor logs using the Azure PowerShell Az module [Enable-AzHDInsightMonitoring](https://docs.microsoft.com/powershell/module/az.hdinsight/enable-azhdinsightmonitoring) cmdlet.
6161

6262
```powershell
6363
# Enter user information
@@ -67,19 +67,32 @@ $LAW = "<your-Log-Analytics-workspace>"
6767
# End of user input
6868
6969
# obtain workspace id for defined Log Analytics workspace
70-
$WorkspaceId = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroup -Name $LAW).CustomerId
70+
$WorkspaceId = (Get-AzOperationalInsightsWorkspace `
71+
-ResourceGroupName $resourceGroup `
72+
-Name $LAW).CustomerId
7173
7274
# obtain primary key for defined Log Analytics workspace
73-
$PrimaryKey = (Get-AzOperationalInsightsWorkspace -ResourceGroupName $resourceGroup -Name $LAW | Get-AzOperationalInsightsWorkspaceSharedKeys).PrimarySharedKey
74-
75-
# Enables Operations Management Suite
76-
Enable-AzHDInsightOperationsManagementSuite -ResourceGroupName $resourceGroup -Name $cluster -WorkspaceId $WorkspaceId -PrimaryKey $PrimaryKey
75+
$PrimaryKey = (Get-AzOperationalInsightsWorkspace `
76+
-ResourceGroupName $resourceGroup `
77+
-Name $LAW | Get-AzOperationalInsightsWorkspaceSharedKeys).PrimarySharedKey
78+
79+
# Enables monitoring and relevant logs will be sent to the specified workspace.
80+
Enable-AzHDInsightMonitoring `
81+
-ResourceGroupName $resourceGroup `
82+
-Name $cluster `
83+
-WorkspaceId $WorkspaceId `
84+
-PrimaryKey $PrimaryKey
85+
86+
# Gets the status of monitoring installation on the cluster.
87+
Get-AzHDInsightMonitoring `
88+
-ResourceGroupName $resourceGroup `
89+
-Name $cluster
7790
```
7891

79-
To disable, the use the [Disable-AzHDInsightOperationsManagementSuite](https://docs.microsoft.com/powershell/module/az.hdinsight/disable-azhdinsightoperationsmanagementsuite) cmdlet:
92+
To disable, the use the [Disable-AzHDInsightMonitoring](https://docs.microsoft.com/powershell/module/az.hdinsight/disable-azhdinsightmonitoring) cmdlet:
8093

8194
```powershell
82-
Disable-AzHDInsightOperationsManagementSuite -Name "<your-cluster>"
95+
Disable-AzHDInsightMonitoring -Name "<your-cluster>"
8396
```
8497

8598
## Install HDInsight cluster management solutions

0 commit comments

Comments
 (0)