Deleting Yandex Unified Agent
The way you delete Unified Agent depends on the way it was installed.
-
View the Unified Agent container ID:
sudo docker ps
-
Stop the container:
sudo docker stop <container_ID>
-
Delete the container:
sudo docker rm <container_ID>
-
Stop Unified Agent:
sudo service unified-agent stop
-
View the deb package name:
sudo dpkg -S /etc/yandex/unified_agent
-
Delete the deb package:
sudo apt remove yandex-unified-agent
-
View the Unified Agent process number and the location of the
unified_agent
file and*.yml
configuration file:ps aux | grep unified_agent
Result:
root 1068 0.0 2.1 2314804 43540 ? Ssl 08:33 0:03 /bin/unified_agent --config /etc/yc/unified_agent/config.yml yc-sa-a+ 4124 0.0 0.1 6612 2272 pts/2 S+ 12:34 0:00 grep --color=auto unified_agent
In this example, the process number is
1068
. -
Stop the Unified Agent process:
sudo kill <process_number>
-
Delete the binary file:
sudo rm -f /usr/bin/unified_agent
-
Delete the configuration file:
sudo rm -f /etc/yc/unified_agent/config.yml
If Unified Agent was installed this way, the unified_agent
binary file and the config.yml
default configuration file are copied to the VM. Therefore, Unified Agent is deleted the same way as the binary file.
Information about the installed Unified Agent is stored in the VM metadata. When deleting Unified Agent, metadata is not updated automatically; however, you can do it manually.
Note
Information in metadata does not affect Unified Agent's operation, so updating is optional.
To delete information about Unified Agent from metadata:
-
Make sure you have installed cURL
. -
Send an API request to update metadata:
curl \ --request PATCH \ --header "Authorization: Bearer <IAM_token>" \ --data '{"updateMask": "metadata", "metadata": {"install-unified-agent": "0" },}' \ https://compute.api.cloud.yandex.net/compute/v1/instances/<VM_ID>
-
View metadata:
-
In the management console
, go to Compute Cloud. -
In the left-hand panel, select
Virtual machines. -
Select the VM and navigate to the Overview tab.
-
Make sure the Agent for delivering metrics parameter is now set to
no
under Monitoring.
-