From 0162e528fb0ea6f98c1e858ab9a26903c48ad625 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 20 Jan 2024 23:18:19 -0500 Subject: [PATCH] telegraf inputs --- ursa-minor/configuration.nix | 60 +++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/ursa-minor/configuration.nix b/ursa-minor/configuration.nix index a2b9965..ccc493f 100644 --- a/ursa-minor/configuration.nix +++ b/ursa-minor/configuration.nix @@ -54,9 +54,67 @@ services.telegraf.enable = true; services.telegraf.extraConfig = { outputs.influxdb = { - urls = [ "https://localhost:8086" ]; + urls = [ "http://127.0.0.1:8086" ]; database = "telegraf"; }; + + inputs.net = { }; + inputs.netstat = { }; + inputs.file = { + files = [ "/sys/class/thermal/thermal_zone0/temp" ]; + name_override = "cpu_temperature"; + data_format = "value"; + data_type = "integer"; + }; + inputs.exec = { + commands = [ "/opt/vc/bin/vcgencmd measure_temp" ]; + name_override = "gpu_temperature"; + data_format = "grok"; + grok_patterns = [ "%{NUMBER:value:float}" ]; + }; + inputs.docker = { + endpoint = "unix:///var/run/docker.sock"; + gather_services = false; + container_name_include = [ ]; + container_name_exclude = [ ]; + timeout = "5s"; + docker_label_include = [ ]; + docker_label_exclude = [ ]; + perdevice = true; + total = false; + }; + inputs.cpu = { + ## Whether to report per-cpu stats or not + percpu = true; + ## Whether to report total system cpu stats or not + totalcpu = true; + ## Comment this line if you want the raw CPU time metrics + fielddrop = [ "time_*" ]; + }; + inputs.disk = { + ## By default, telegraf gather stats for all mountpoints. + ## Setting mountpoints will restrict the stats to the specified mountpoints. + # mount_points = ["/"] + + ## Ignore some mountpoints by filesystem type. For example (dev)tmpfs (usually + ## present on /run, /var/run, /dev/shm or /dev). + ignore_fs = [ "tmpfs" "devtmpfs" ]; + }; + inputs.diskio = { + ## By default, telegraf will gather stats for all devices including + ## disk partitions. + ## Setting devices will restrict the stats to the specified devices. + # devices = ["sda", "sdb"] + ## Uncomment the following line if you need disk serial numbers. + # skip_serial_number = false + }; + inputs.kernel = { }; + inputs.mem = { }; + inputs.processes = { }; + inputs.swap = { }; + inputs.system = { }; + inputs.interrupts = { }; + inputs.linux_sysctl_fs = { }; }; # Define a user account. Don't forget to set a password with ‘passwd’.