Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, April 4, 2018 10:28 AM
Hello.
I have deployed several Linux base VMs but I could not install OMSAgentForLinux extension on any of my VM.
I have tried to install this extension from Azure portal and by Azure CLI - but installation was hanging and died after timeout. After that status of this extension is (unavailable).
I have tried to install this extension according to article /en-us/azure/log-analytics/log-analytics-quick-collect-linux-computer and I observed that installation was successful, but in that case I see that all indicators of working OMS agent is in unknown or failed status on Azure portal.
Please could You share correct way to install OMSAgentForLinux extension.
Thanks
All replies (4)
Wednesday, April 4, 2018 1:24 PM
If the OMS Agent for Linux VM extension is not installing or reporting, you can perform the following steps to troubleshoot the issue.
1.If the extension status is Unknown check if the Azure VM agent is installed and working correctly by reviewing the VM agent log file /var/log/waagent.log
If the log does not exist, the VM agent is not installed.
Install the Azure VM Agent on Linux VMs
2.For other unhealthy statuses, review the OMS Agent for Linux VM extension logs files in /var/log/azure/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux/*/extension.log and
/var/log/azure/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux/*/CommandExecution.log
3.If the extension status is healthy, but data is not being uploaded review the OMS Agent for Linux log files in /var/opt/microsoft/omsagent/log/omsagent.log
For more information, see troubleshooting Linux extensions
Refer the below article for more information:
/en-us/azure/log-analytics/log-analytics-azure-vmext-troubleshoot#troubleshooting-linux-vm-extension
Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members
Thursday, April 5, 2018 6:21 AM
Hello.
Azure VM Agent is installed.
For example, right now I have OMSAgentForLinux in Failed status. I have tried remove this extension - OK. Next I have tried to install this extension back:
sergey@DSKTP006-RU01:~$ az vm extension list --resource-group vnet --vm-name rabbit01-az-eus -o table
Name ProvisioningState Publisher Version AutoUpgradeMinorVersion
LinuxDiagnostic Succeeded Microsoft.OSTCExtensions 2.3 True
OmsAgentForLinux Failed Microsoft.EnterpriseCloud.Monitoring 1 True
sergey@DSKTP006-RU01:~$ az vm extension delete --resource-group vnet --vm-name rabbit01-az-eus -n OmsAgentForLinux
{
"additionalProperties": {},
"endTime": "2018-04-05T05:56:06.499955+00:00",
"error": null,
"name": "0332366d-127a-413e-86e2-a6733a100b7d",
"startTime": "2018-04-05T05:55:56.187412+00:00",
"status": "Succeeded"
}
sergey@DSKTP006-RU01:~$ az vm extension list --resource-group vnet --vm-name rabbit01-az-eus -o table
Name ProvisioningState Publisher Version AutoUpgradeMinorVersion
LinuxDiagnostic Succeeded Microsoft.OSTCExtensions 2.3 True
sergey@DSKTP006-RU01:~$ az vm extension set --resource-group vnet --vm-name rabbit01-az-eus --name OmsAgentForLinux --publisher Microsoft.EnterpriseCloud.Monitoring --version 1.4 --protected-settings '{"workspaceKey": "myKey"}' --settings '{"workspaceId": "myID"}'
- Running ..
And installation process is hanging.
In waagent.log I see these strings:
2018/04/05 01:58:41.860881 INFO Event: name=WALinuxAgent, op=Firewall, message=, duration=0
2018/04/05 02:06:08.947125 INFO [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] Target handler state: enabled
2018/04/05 02:06:08.966848 INFO [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] [Enable] current handler state is: enabled
2018/04/05 02:06:08.971903 INFO [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] Update settings file: 0.settings
2018/04/05 02:06:08.979601 INFO [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] Enable extension [diagnostic.py -enable]
2018/04/05 02:06:09 LinuxAzureDiagnostic started to handle.
2018/04/05 02:06:09 [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] cwd is /var/lib/waagent/Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029
2018/04/05 02:06:09 [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] Change log file to /var/log/azure/Microsoft.OSTCExtensions.LinuxDiagnostic/2.3.9029/extension.log
2018/04/05 02:06:09 LinuxAzureDiagnostic started to handle.
2018/04/05 02:06:09 [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] cwd is /var/lib/waagent/Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029
2018/04/05 02:06:09 [Microsoft.OSTCExtensions.LinuxDiagnostic-2.3.9029] Change log file to /var/log/azure/Microsoft.OSTCExtensions.LinuxDiagnostic/2.3.9029/extension.log
2018/04/05 02:07:50.149612 INFO Event: name=Microsoft.OSTCExtensions.LinuxDiagnostic, op=Enable, message=Launch command succeeded: diagnostic.py -enable, duration=0
2018/04/05 02:07:50.330302 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: enabled
2018/04/05 02:07:50.345552 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Enable] current handler state is: notinstalled
2018/04/05 02:07:52.657608 INFO Event: name=Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux, op=Download, message=Download succeeded, duration=0
2018/04/05 02:07:52.671365 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Initialize extension directory
2018/04/05 02:07:52.683726 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Update settings file: 0.settings
2018/04/05 02:07:52.685145 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Install extension [omsagent.py -install]
2018/04/05 02:07:53.747452 ERROR Event: name=Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux, op=Install, message=[ExtensionError] Non-zero exit code: 1, omsagent.py -install, duration=0
2018/04/05 02:07:53.875907 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Remove extension handler directory: /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2
2018/04/05 02:07:54.557799 INFO Event: name=WALinuxAgent, op=ProcessGoalState, message=Incarnation 5, duration=105872
In /var/log/azure/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux/1.4.60.2/CommandExecution.log i see:
2018/04/04 09:13:08.228452 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: uninstall
2018/04/04 09:13:08.240689 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Uninstall] current handler state is: notinstalled
2018/04/04 17:26:01.224391 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: enabled
2018/04/04 17:26:01.293630 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Enable] current handler state is: notinstalled
2018/04/04 17:26:04.333541 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Initialize extension directory
2018/04/04 17:26:04.350020 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Update settings file: 0.settings
2018/04/04 17:26:04.352122 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Install extension [omsagent.py -install]
2018/04/04 17:26:06.048952 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Remove extension handler directory: /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2
2018/04/05 01:57:42.472425 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: uninstall
2018/04/05 01:57:42.484605 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Uninstall] current handler state is: notinstalled
2018/04/05 02:07:50.330302 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: enabled
2018/04/05 02:07:50.345552 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Enable] current handler state is: notinstalled
2018/04/05 02:07:52.671365 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Initialize extension directory
2018/04/05 02:07:52.683726 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Update settings file: 0.settings
2018/04/05 02:07:52.685145 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Install extension [omsagent.py -install]
2018/04/05 02:07:53.875907 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Remove extension handler directory: /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2
Thursday, April 5, 2018 9:14 AM
After several hours I got timeout error:
Deployment failed. Correlation ID: bd61b0a6-c1dc-4ebb-9789-dfd7d4df72b4. Provisioning of VM extension 'OmsAgentForLinux' has timed out. Extension installation may be taking too long, or extension status could not be obtained.
In waagent.log:
2018/04/05 02:07:53.747452 ERROR Event: name=Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux, op=Install, message=[ExtensionError] Non-zero exit code: 1, omsagent.py -install, duration=0
2018/04/05 02:07:53.875907 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Remove extension handler directory: /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2
2018/04/05 02:07:54.557799 INFO Event: name=WALinuxAgent, op=ProcessGoalState, message=Incarnation 5, duration=105872
2018/04/05 02:58:44.966403 INFO Event: name=WALinuxAgent, op=Firewall, message=, duration=0
2018/04/05 03:58:45.843578 INFO Event: name=WALinuxAgent, op=Firewall, message=, duration=0
2018/04/05 04:58:46.641665 INFO Event: name=WALinuxAgent, op=Firewall, message=, duration=0
In CommandExecution.log:
2018/04/05 02:07:50.330302 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Target handler state: enabled
2018/04/05 02:07:50.345552 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] [Enable] current handler state is: notinstalled
2018/04/05 02:07:52.671365 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Initialize extension directory
2018/04/05 02:07:52.683726 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Update settings file: 0.settings
2018/04/05 02:07:52.685145 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Install extension [omsagent.py -install]
2018/04/05 02:07:53.875907 INFO [Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2] Remove extension handler directory: /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.4.60.2
And output of listing extensions:
sergey@DSKTP006-RU01:~$ az vm extension list --resource-group vnet --vm-name rabbit01-az-eus -o table
Name ProvisioningState Publisher Version AutoUpgradeMinorVersion
LinuxDiagnostic Succeeded Microsoft.OSTCExtensions 2.3 True
OmsAgentForLinux Failed Microsoft.EnterpriseCloud.Monitoring 1.4 True
Thursday, November 7, 2019 1:34 PM
This is a problem in power cli with this character " you can use the below cli command it works.
az vm extension set --name OmsAgentForLinux --publisher Microsoft.EnterpriseCloud.Monitoring --version 1.11.15 --protected-settings'{"workspaceKey":"'"yourspaceKey"'"}' --settings'{"workspaceId":"'"yourworkspaceid"'"}' --resource-group yourgoup --vm-name yourvm --no-auto-upgrade
Replace the below character
"="'"