|
| 1 | +# Telegraf Configuration |
| 2 | +# |
| 3 | +# Configuration for telegraf agent |
| 4 | +[agent] |
| 5 | + interval = "10s" |
| 6 | + round_interval = true |
| 7 | + flush_interval = "10s" |
| 8 | + metric_batch_size = 1000 |
| 9 | + metric_buffer_limit = 10000 |
| 10 | + |
| 11 | +############################################################################### |
| 12 | +# OUTPUT PLUGINS # |
| 13 | +############################################################################### |
| 14 | +# Define the main metric output file, excluding aggregated stats and |
| 15 | +# Performance Playbook (estat) data. |
| 16 | +[[outputs.file]] |
| 17 | + files = ["/var/log/telegraf/metrics.json"] |
| 18 | + rotation_max_size = "50MB" |
| 19 | + rotation_max_archives = 9 |
| 20 | + data_format = "json" |
| 21 | + namedrop = ["*estat_*", "agg_*", "zfs", "zpool*", "zcache*"] |
| 22 | + |
| 23 | +# Define output file for ZFS related metrics |
| 24 | +[[outputs.file]] |
| 25 | + files = ["/var/log/telegraf/metrics_zfs.json"] |
| 26 | + rotation_max_size = "30MB" |
| 27 | + rotation_max_archives = 5 |
| 28 | + data_format = "json" |
| 29 | + namepass = ["zpool*", "zcache*", "zfs"] |
| 30 | + |
| 31 | +# Define output file for Performance Playbook (estat) metrics |
| 32 | +[[outputs.file]] |
| 33 | + files = ["/var/log/telegraf/metrics_estat.json"] |
| 34 | + rotation_max_size = "30MB" |
| 35 | + rotation_max_archives = 5 |
| 36 | + data_format = "json" |
| 37 | + namepass = ["*estat_*"] |
| 38 | + |
| 39 | +# Define output file for aggregate statistics |
| 40 | +[[outputs.file]] |
| 41 | + files = ["/var/log/telegraf/metric_aggregates.json"] |
| 42 | + rotation_max_size = "30MB" |
| 43 | + rotation_max_archives = 5 |
| 44 | + data_format = "json" |
| 45 | + namepass = ["agg_*"] |
| 46 | + |
| 47 | +# Enable Live Monitoring, intended for internal use: |
| 48 | +#[[outputs.influxdb]] |
| 49 | +# urls = ["http://dbsvr.company.com:8086"] |
| 50 | +# database = "live_metrics" |
| 51 | +# skip_database_creation = true |
| 52 | +# data_format = "influx" |
| 53 | + |
| 54 | +############################################################################### |
| 55 | +# INPUT PLUGINS # |
| 56 | +############################################################################### |
| 57 | + |
| 58 | +# Get CPU usage |
| 59 | +[[inputs.cpu]] |
| 60 | + percpu = true |
| 61 | + totalcpu = true |
| 62 | + collect_cpu_time = false |
| 63 | + report_active = false |
| 64 | + fieldpass = ["usage*"] |
| 65 | + |
| 66 | +# Get mount point stats |
| 67 | +[[inputs.disk]] |
| 68 | + mount_points = ["/","/domain0"] |
| 69 | + |
| 70 | +# Get disk I/O stats |
| 71 | +[[inputs.diskio]] |
| 72 | + |
| 73 | +# Track stats for the current metric files |
| 74 | +[[inputs.filestat]] |
| 75 | + files = ["/var/log/telegraf/metrics.json", |
| 76 | + "/var/log/telegraf/metrics_estat.json", |
| 77 | + "/var/log/telegraf/metrics_zfs.json", |
| 78 | + "/var/log/telegraf/metric_aggregates.json"] |
| 79 | + |
| 80 | +# Get Memory stats |
| 81 | +[[inputs.mem]] |
| 82 | + |
| 83 | +# Get some network interface stats |
| 84 | +[[inputs.net]] |
| 85 | + fieldpass = ["tcp*","bytes*","packets*","err*","drop*"] |
| 86 | + |
| 87 | +# Track CPU and Memory for the "delphix-mgmt" service (and children). |
| 88 | +[[inputs.procstat]] |
| 89 | + systemd_unit = "delphix-mgmt.service" |
| 90 | + include_systemd_children = true |
| 91 | + namedrop = ["procstat_lookup"] |
| 92 | + fieldpass = ["memory_usage", "cpu_usage", "memory_rss"] |
| 93 | + |
| 94 | +# Track CPU and Memory for the "zfs-object-agent" service (and children). |
| 95 | +[[inputs.procstat]] |
| 96 | + systemd_unit = "zfs-object-agent.service" |
| 97 | + include_systemd_children = true |
| 98 | + namedrop = ["procstat_lookup"] |
| 99 | + fieldpass = ["memory_usage", "cpu_usage", "memory_rss"] |
| 100 | + |
| 101 | +# Get process counts |
| 102 | +[[inputs.processes]] |
| 103 | + |
| 104 | +# Get swap memory usage |
| 105 | +[[inputs.swap]] |
| 106 | + |
| 107 | +# Get misc 'other' stats (load and uptime) |
| 108 | +[[inputs.system]] |
| 109 | + |
| 110 | +# ZFS kstats (arcstat, abdstat, zfetch, etc) |
| 111 | +[[inputs.zfs]] |
| 112 | + interval = "1m" |
| 113 | + |
| 114 | +# Detailed ZFS pool metrics from "zpool_influxdb" (noisy) |
| 115 | +#[[inputs.exec]] |
| 116 | +# commands = ["/usr/lib/x86_64-linux-gnu/zfs/zpool_influxdb"] |
| 117 | +# data_format = "influx" |
| 118 | + |
| 119 | +############################################################################### |
| 120 | +# AGGREGATION PLUGINS # |
| 121 | +############################################################################### |
| 122 | +# Filtered aggregate statistics |
| 123 | +# Calculate Min, Max, Mean, Std Deviation every hour for selected metrics: |
| 124 | +# CPU Usage (%idle) |
| 125 | +[[aggregators.basicstats]] |
| 126 | + period = "1h" |
| 127 | + drop_original = false |
| 128 | + stats = ["min", "max", "mean", "stdev"] |
| 129 | + name_prefix = "agg_" |
| 130 | + namepass = ["cpu","disk","diskio","mem","net","processes","system","swap"] |
| 131 | + |
0 commit comments