Telegraf

From Leo's Notes
Revision as of 23:46, 13 January 2021 by Leo (talk | contribs) (→Tasks)
This page was last edited on 13 January 2021, at 23:46.

Telegraf is an agent that pushes metrics to a server, such as InfluxDB.

Tasks

Monitoring CPU frequency

Simplest way is to use an exec input:

[[inputs.exec]]
  commands = ["bash -c \"cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq | /bin/awk '{freq += \\$1; n++} END{printf(\\\"%f\\\", freq/n/1000); }'\" "]
  name_override = "cpu_freq"
  data_format = "value"
  data_type = "float"