Reputation: 1995
I need to re-install oms agent for a Linux machine, is there a way to do this via Azure power shell or via the portal?
Upvotes: 1
Views: 1406
Reputation: 10960
You can follow this steps
To remove the existing agent and then install the new agent, follow these steps:
- Connect to the Linux computer, and then open a terminal session. To
download the desired script, run the following command:
wget https://raw.githubusercontent.com/Microsoft/OMS-Agent-for-Linux/master/installer/scripts/onboard_agent.sh
.
- Run
sudo sh onboard_agent.sh --purge
. This downloads the most recent version of the installation script and runs the uninstall ation operation that will remove all existing agent components.- Remove the
/etc/opt/microsoft/omsagent and /var/opt/microsoft/omsagent
folders.- Run the following command:
sudo sh onboard_agent.sh -w <workspaceid> -s <primarykey>
Notes
In this command, replace and with the appropriate values from the actual Azure workspace ID and primary key, respectively.
If you're using a cloud service other than Azure public cloud, you must add the -d parameter that identifies the domain that's to be used. For example, if you use the Azure US Government cloud, run the following command:
sudo sh onboard_agent.sh -w workspaceid -s primarykey -d opinsights.azure.us
Upvotes: 1