VK Cloud logo
Updated at February 15, 2024   03:26 AM

Installation in existing VMs

To install monitoring to an existing VM:

  1. Go to your VK Cloud personal account.
  2. Go to Cloud computingVirtual machines.
  3. Open the VM page by clicking on its name in the list.
  4. On the General information tab, under the main VM information, go to the Configuring monitoring tab.
  5. Copy the command that appears.
  6. Connect to the virtual machine.
  7. On the connected VM, run the command copied in step 5.

The monitoring agent will be installed and will start every time the VM starts.

If the Configuring monitoring tab is missing:

  1. Make sure two-factor authentication is enabled and API access is activated.

  2. Get an access token X-Subject-Token.

  3. Get the Project ID, a special identifier for working with services. Example: a1b2c3d4e5f6g7h8i9a1b2c3d4e5f6g7.

  4. Get the virtual machine ID.

  5. Connect to the virtual machine.

  6. Run the command:

    curl \-H "content-type: application/json" \-H "X-Auth-Token: <access token X-Subject-Token>" \-d '{"instance_id":"<virtual machine ID>", "capabilities":["telegraf"], "os_type":"linux"}' \-X POST  https://mcs.mail.ru/infra/templater/v2/project/<Project ID>/link
  7. Execute the command from the contents of the response script parameter.

    sudo curl -s -H 'content-type: application/json' -X POST https://mcs.mail.ru/infra/templater/v2/project/<Project ID>/link/XXXXUm5Yb33LJ7otcPnWSUXXXXXXXXXX/instance/<virtual machine ID> | sudo bash