VK Cloud logo

Managing telegraf and its plugins

Viewing agent status

  1. Make sure, that the telegraf monitoring agent is installed.

  2. Connect to the virtual machine.

  3. Run the command:

    systemctl -l status telegraf

Enabling or disabling the agent

  1. Make sure, that the telegraf monitoring agent is installed.
  2. Connect to the virtual machine.
  • To enable the agent, run the command:

    sudo systemctl start telegraf
  • To disable the agent, run the command:

    sudo systemctl stop telegraf

Enabling or disabling metrics

  1. Make sure, that the telegraf monitoring agent is installed.

  2. Connect to the virtual machine.

  3. Find and edit the file /etc/telegraf/telegraf.conf: add or remove the parameters for monitoring.

    Example for CPU monitoring in Linux:

    [[inputs.cpu]]  percpu = false  totalcpu = true  collect_cpu_time = true  report_active = false  fieldpass = ["usage_user", "usage_system", "usage_iowait", "usage_irq", "usage_guest", "time_idle"]
  4. Apply the new configuration using the command:

    sudo systemctl reload telegraf.service

Enabling or disabling the plugin for configuring additional metrics

  1. Make sure, that the telegraf monitoring agent is installed.

  2. Connect to the virtual machine.

  3. Find and edit the file /etc/telegraf/telegraf.conf: add or remove the desired plugin.

    Example of adding the mysql plugin in Linux:

    [[inputs.mysql]]  servers = ["tcp(127.0.0.1:3306)/"]  metric_version = 2
  4. Apply the new configuration using the command:

    sudo systemctl reload telegraf.service

Viewing agent logs

  1. Make sure, that the telegraf monitoring agent is installed.

  2. Connect to the virtual machine.

  3. Run the command:

    journalctl -u telegraf

Deleting the agent

  1. Make sure, that the telegraf monitoring agent is installed.

  2. Connect to the virtual machine.

  3. Run the command:

    sudo yum erase telegraf
Was this article helpful?