Managing telegraf and its plugins
-
Make sure, that the telegraf monitoring agent is installed.
-
Connect to the virtual machine.
-
Run the command:
Linuxsystemctl -l status telegraf
-
To enable the agent, run the command:
Linuxsudo systemctl start telegraf -
To disable the agent, run the command:
Linuxsudo systemctl stop telegraf
-
Make sure, that the telegraf monitoring agent is installed.
-
Connect to the virtual machine.
-
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 = falsetotalcpu = truecollect_cpu_time = truereport_active = falsefieldpass = ["usage_user", "usage_system", "usage_iowait", "usage_irq", "usage_guest", "time_idle"] -
Apply the new configuration using the command:
Linuxsudo systemctl reload telegraf.service
-
Make sure, that the telegraf monitoring agent is installed.
-
Connect to the virtual machine.
-
Find and edit the file
/etc/telegraf/telegraf.conf: add or remove the desired plugin.Example of adding the
mysqlplugin in Linux:[[inputs.mysql]]servers = ["tcp(127.0.0.1:3306)/"]metric_version = 2 -
Apply the new configuration using the command:
Linuxsudo systemctl reload telegraf.service
Was this article helpful?