# --------------------------------------------------- Defaults --------------------------------------------- # Read CPU metrics [[inputs.cpu]] ## Whether to report per-cpu stats or not percpu = true ## Whether to report total system cpu stats or not totalcpu = true ## If true, collect raw CPU time metrics. collect_cpu_time = false ## If true, compute and report the sum of all non-idle CPU states. report_active = false # Gather metrics from disks [[inputs.disk]] interval = "5m" ## Ignore mount points by filesystem type. ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] # Read metrics about disk IO by device [[inputs.diskio]] # Read HDD temp metric from the hddtemp daemon #[[inputs.hddtemp]] # Read metrics about system load & uptime [[inputs.system]] ## Uncomment to remove deprecated metrics. fielddrop = ["uptime_format"] # Get kernel statistics from /proc/stat [[inputs.kernel]] # no configuration # Read metrics about memory usage [[inputs.mem]] # no configuration # Get the number of processes and group them by status [[inputs.processes]] # no configuration # Read metrics about swap memory usage #[[inputs.swap]] # no configuration # Read metrics about system load & uptime [[inputs.system]] # no configuratiion # Read metrics about the IRQ [[inputs.interrupts]] cpu_as_tag = false #[[inputs.linux_sysctl_fs]] # Gather metrics about network interfaces [[inputs.net]] ignore_protocol_stats = false # Collect TCP connections state and UDP socket counts [[inputs.netstat]] # no configuration # Gather metrics from /proc/net/* files #[[inputs.nstat]] # ----------------------------------------------------- Top processes (default) ---------------------------------- [[inputs.procstat]] pattern = "." pid_tag = false pid_finder = "native" fieldpass = [ "num_threads", "cpu_usage", "memory_rss", ] [[processors.topk]] # see: https://github.com/influxdata/telegraf/blob/release-1.17/plugins/processors/topk/README.md namepass = ["*procstat*"] aggregation = "max" k = 10 fields = [ "num_threads", "cpu_usage", "memory_rss", ] [[processors.regex]] namepass = ["*procstat*"] [[processors.regex.tags]] key = "process_name" pattern = "^(.{60}).*" replacement = "${1}..." # ------------------------------------------------------ Raspberry Pi --------------------------------------------- # Read RPi CPU temperature [[inputs.exec]] commands = [ '''sed -e 's/^\([0-9]\{2\}\)\(.*\)$/\1.\2/' /sys/class/thermal/thermal_zone0/temp''' ] name_override = "sys" data_format = "grok" grok_patterns = ["%{NUMBER:thermal_zone0:float}"] # Vcgencmd input [[inputs.exec]] commands = ["/var/lib/telegraf/vcgencmd.sh"] timeout = "7s" data_format = "influx"