unable to remove linux vm from log analytics

vivek8647 41 Reputation points
2022-03-28T12:40:33.347+00:00

onbarded the linux vm to log analytics workspace, after testing trying to remove but unable to find the proper steps to remove vm from the workspace.

Microsoft Security Microsoft Defender Microsoft Defender for Cloud
0 comments No comments
{count} votes

Accepted answer
  1. Givary-MSFT 35,621 Reputation points Microsoft Employee Moderator
    2022-03-29T10:22:22.94+00:00

    @vivek8647

    Thank you for reaching out to us.

    Follow the below steps to remove linux vm from the log analytics workspace

    Step1 : In the Azure portal > select Linux virtual machine > oms extension > Please click on uninstall button

    Step 2: To check status of the oms service

    systemctl status walinuxagent

    To stop the service

    systemctl stop walinuxagent

    Step 3 : Please remove old versions of the core packages (if they still exist). Please uninstall those packages:

    To check the packages :
    dpkg -l | grep omsagent
    dpkg -l | grep omi
    dpkg -l | grep scx
    dpkg -l | grep auoms

    Step 4: To remove the packages :

    apt purge omsagent
    apt purge omi
    apt purge scx
    apt purge auoms

    Step 5 : Please check below locations and remove them if they exist:

    rm -rf /var/lib/waagent/Microsoft.EnterpriseCloud.Monitoring.OmsAgentForLinux-1.14.9/*
    rm -rf /var/opt/omi
    rm -rf /var/opt/microsoft/omsagent/LAD/
    rm -rf /etc/opt/microsoft/omsagent
    rm -rf /etc/opt/omi
    rm -rf /var/opt/microsoft/omsagent

    wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh

    chmod +x ./onboard_agent.sh

    sudo ./onboard_agent.sh --purge

    Before start the service please check if there is any process that still running :
    ps -ef | grep -i omi
    ps -ef | grep -i oms

    To stop the service << if the service is running incase then only execute it >>

    systemctl stop walinuxagent

    Let me know if the above steps resolve your issue or if you need any help.

    If this answer was helpful to you, please consider "marking as answer" so that others in the community with similar questions will more easily find the resolution.

    0 comments No comments

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.