Log Analytics workspaces - Log Analytics Connection showing "Error" on VMs and unable to disconnect agent

Seth Berg 41 Reputation points
2023-01-07T15:37:29.377+00:00

Good morning all:

We have been attempting to address the following error on some of our VMs for Log Analytics workspaces:

277161-image.png

Here are the tshooting steps we have attempted to take:

  • Remove the agent via Azure Portal = This did not remove the agent from the VM.
  • Manually remove the agent from the VM = This removed the agent from the VM, but we are still receiving this error

After attempting the above, it still will not allow us to disconnect the agent from the VM. When selecting the VM right before attempting to disconnect the agent, we see this error:

277088-image.png

When we do select disconnect, it takes a while before it errors out and does not complete the disconnect.

Has anyone ever ran into this issue and if so, how do you resolve it? Any assistance or insight with this issue is greatly appreciated!

Seth Berg

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,469 questions
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,476 Reputation points
    2023-01-16T15:20:36.4666667+00:00

    @Seth Berg I see that you had used the "Enable" option available in VM's "Logs" section to enable Monitoring, as shown below:

    User's image

    This option installs the old "Log analytics agent" or (OMSagent). As seen in the screenshot above (for extesions), OMSAgentForLinux is stuck in Transitioning state which is why you are getting the error.

    As the state of agent is Transitioning, it appears that the agent installation was kicked off, but it never finished/reported back its status to Azure/Log Analytics Workspace. In this regard, the troubleshooting steps mentioned in the following article should help resolve or diagnose this issue further - Troubleshoot issues with the Log Analytics agent for Linux

    If you have already removed the agent from the VM manually, use the Remove-AzVMExtension cmdlet to try remove the VM extension - if it errors out, the returned error message should give a better understanding of the issue. Please see the following for more details - Remove-AzVMExtension

    Finally, you could also try purging and reinstalling the agent using the steps mentioned here - How to reinstall Operations Management Suite (OMS) Agent for Linux

    Please let me know if you have any questions. Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.