Advertisement
Guest User

Untitled

a guest
Feb 7th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.84 KB | None | 0 0
  1. # Telegraf Configuration
  2. #
  3. # Telegraf is entirely plugin driven. All metrics are gathered from the
  4. # declared inputs, and sent to the declared outputs.
  5. #
  6. # Plugins must be declared in here to be active.
  7. # To deactivate a plugin, comment out the name and any variables.
  8. #
  9. # Use 'telegraf -config telegraf.conf -test' to see what metrics a config
  10. # file would generate.
  11. #
  12. # Environment variables can be used anywhere in this config file, simply prepend
  13. # them with $. For strings the variable must be within quotes (ie, "$STR_VAR"),
  14. # for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)
  15.  
  16.  
  17. # Global tags can be specified here in key="value" format.
  18. [global_tags]
  19. # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  20. # rack = "1a"
  21. ## Environment variables can be used as tags, and throughout the config file
  22. # user = "$USER"
  23.  
  24.  
  25. # Configuration for telegraf agent
  26. [agent]
  27. ## Default data collection interval for all inputs
  28. interval = "10s"
  29. ## Rounds collection interval to 'interval'
  30. ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  31. round_interval = true
  32.  
  33. ## Telegraf will send metrics to outputs in batches of at most
  34. ## metric_batch_size metrics.
  35. ## This controls the size of writes that Telegraf sends to output plugins.
  36. metric_batch_size = 1000
  37.  
  38. ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
  39. ## output, and will flush this buffer on a successful write. Oldest metrics
  40. ## are dropped first when this buffer fills.
  41. ## This buffer only fills when writes fail to output plugin(s).
  42. metric_buffer_limit = 10000
  43.  
  44. ## Collection jitter is used to jitter the collection by a random amount.
  45. ## Each plugin will sleep for a random time within jitter before collecting.
  46. ## This can be used to avoid many plugins querying things like sysfs at the
  47. ## same time, which can have a measurable effect on the system.
  48. collection_jitter = "0s"
  49.  
  50. ## Default flushing interval for all outputs. Maximum flush_interval will be
  51. ## flush_interval + flush_jitter
  52. flush_interval = "10s"
  53. ## Jitter the flush interval by a random amount. This is primarily to avoid
  54. ## large write spikes for users running a large number of telegraf instances.
  55. ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  56. flush_jitter = "0s"
  57.  
  58. ## By default or when set to "0s", precision will be set to the same
  59. ## timestamp order as the collection interval, with the maximum being 1s.
  60. ## ie, when interval = "10s", precision will be "1s"
  61. ## when interval = "250ms", precision will be "1ms"
  62. ## Precision will NOT be used for service inputs. It is up to each individual
  63. ## service input to set the timestamp at the appropriate precision.
  64. ## Valid time units are "ns", "us" (or "µs"), "ms", "s".
  65. precision = ""
  66.  
  67. ## Logging configuration:
  68. ## Run telegraf with debug log messages.
  69. debug = true
  70. ## Run telegraf in quiet mode (error log messages only).
  71. quiet = false
  72. ## Specify the log file name. The empty string means to log to stderr.
  73. logfile = "/Program Files/Telegraf/telegraf.log"
  74.  
  75. ## Override default hostname, if empty use os.Hostname()
  76. hostname = ""
  77. ## If set to true, do no set the "host" tag in the telegraf agent.
  78. omit_hostname = false
  79.  
  80.  
  81. ###############################################################################
  82. # OUTPUTS #
  83. ###############################################################################
  84.  
  85. # Configuration for sending metrics to InfluxDB
  86. [[outputs.influxdb]]
  87. ## The full HTTP or UDP URL for your InfluxDB instance.
  88. ##
  89. ## Multiple URLs can be specified for a single cluster, only ONE of the
  90. ## urls will be written to each interval.
  91. # urls = ["unix:///var/run/influxdb.sock"]
  92. # urls = ["udp://127.0.0.1:8089"]
  93. url = ["http://127.0.0.1:8086"]
  94.  
  95. ## The target database for metrics; will be created as needed.
  96. database = "telegraf2"
  97.  
  98. ## If true, no CREATE DATABASE queries will be sent. Set to true when using
  99. ## Telegraf with a user without permissions to create databases or when the
  100. ## database already exists.
  101. # skip_database_creation = false
  102.  
  103. ## Name of existing retention policy to write to. Empty string writes to
  104. ## the default retention policy. Only takes effect when using HTTP.
  105. # retention_policy = ""
  106.  
  107. ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  108. ## Only takes effect when using HTTP.
  109. # write_consistency = "any"
  110.  
  111. ## Timeout for HTTP messages.
  112. # timeout = "5s"
  113.  
  114. ## HTTP Basic Auth
  115. # username = "admin"
  116. # password = "Zxcdsa21"
  117.  
  118. ## HTTP User-Agent
  119. # user_agent = "telegraf"
  120.  
  121. ## UDP payload size is the maximum packet size to send.
  122. # udp_payload = "512B"
  123.  
  124. ## Optional TLS Config for use on HTTP connections.
  125. # tls_ca = "/etc/telegraf/ca.pem"
  126. # tls_cert = "/etc/telegraf/cert.pem"
  127. # tls_key = "/etc/telegraf/key.pem"
  128. ## Use TLS but skip chain & host verification
  129. # insecure_skip_verify = false
  130.  
  131. ## HTTP Proxy override, if unset values the standard proxy environment
  132. ## variables are consulted to determine which proxy, if any, should be used.
  133. # http_proxy = "http://corporate.proxy:3128"
  134.  
  135. ## Additional HTTP headers
  136. # http_headers = {"X-Special-Header" = "Special-Value"}
  137.  
  138. ## HTTP Content-Encoding for write request body, can be set to "gzip" to
  139. ## compress body or "identity" to apply no encoding.
  140. # content_encoding = "identity"
  141.  
  142. ## When true, Telegraf will output unsigned integers as unsigned values,
  143. ## i.e.: "42u". You will need a version of InfluxDB supporting unsigned
  144. ## integer values. Enabling this option will result in field type errors if
  145. ## existing data has been written.
  146. # influx_uint_support = false
  147.  
  148.  
  149. ###############################################################################
  150. # INPUTS #
  151. ###############################################################################
  152.  
  153. # Windows Performance Counters plugin.
  154. # These are the recommended method of monitoring system metrics on windows,
  155. # as the regular system plugins (inputs.cpu, inputs.mem, etc.) rely on WMI,
  156. # which utilize more system resources.
  157. #
  158. # See more configuration examples at:
  159. # https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters
  160.  
  161. [[inputs.win_perf_counters]]
  162. [[inputs.win_perf_counters.object]]
  163. # Processor usage, alternative to native, reports on a per core.
  164. ObjectName = "Processor"
  165. Instances = ["*"]
  166. Counters = [
  167. "% Idle Time",
  168. "% Interrupt Time",
  169. "% Privileged Time",
  170. "% User Time",
  171. "% Processor Time",
  172. "% DPC Time",
  173. ]
  174. Measurement = "win_cpu"
  175. # Set to true to include _Total instance when querying for all (*).
  176. IncludeTotal=true
  177.  
  178. [[inputs.win_perf_counters.object]]
  179. # Disk times and queues
  180. ObjectName = "LogicalDisk"
  181. Instances = ["*"]
  182. Counters = [
  183. "% Idle Time",
  184. "% Disk Time",
  185. "% Disk Read Time",
  186. "% Disk Write Time",
  187. "Current Disk Queue Length",
  188. "% Free Space",
  189. "Free Megabytes",
  190. ]
  191. Measurement = "win_disk"
  192. # Set to true to include _Total instance when querying for all (*).
  193. #IncludeTotal=false
  194.  
  195. [[inputs.win_perf_counters.object]]
  196. ObjectName = "PhysicalDisk"
  197. Instances = ["*"]
  198. Counters = [
  199. "Disk Read Bytes/sec",
  200. "Disk Write Bytes/sec",
  201. "Current Disk Queue Length",
  202. "Disk Reads/sec",
  203. "Disk Writes/sec",
  204. "% Disk Time",
  205. "% Disk Read Time",
  206. "% Disk Write Time",
  207. ]
  208. Measurement = "win_diskio"
  209.  
  210. [[inputs.win_perf_counters.object]]
  211. ObjectName = "Network Interface"
  212. Instances = ["*"]
  213. Counters = [
  214. "Bytes Received/sec",
  215. "Bytes Sent/sec",
  216. "Packets Received/sec",
  217. "Packets Sent/sec",
  218. "Packets Received Discarded",
  219. "Packets Outbound Discarded",
  220. "Packets Received Errors",
  221. "Packets Outbound Errors",
  222. ]
  223. Measurement = "win_net"
  224.  
  225. [[inputs.win_perf_counters.object]]
  226. ObjectName = "System"
  227. Counters = [
  228. "Context Switches/sec",
  229. "System Calls/sec",
  230. "Processor Queue Length",
  231. "System Up Time",
  232. ]
  233. Instances = ["------"]
  234. Measurement = "win_system"
  235. # Set to true to include _Total instance when querying for all (*).
  236. #IncludeTotal=false
  237.  
  238. [[inputs.win_perf_counters.object]]
  239. # Example query where the Instance portion must be removed to get data back,
  240. # such as from the Memory object.
  241. ObjectName = "Memory"
  242. Counters = [
  243. "Available Bytes",
  244. "Cache Faults/sec",
  245. "Demand Zero Faults/sec",
  246. "Page Faults/sec",
  247. "Pages/sec",
  248. "Transition Faults/sec",
  249. "Pool Nonpaged Bytes",
  250. "Pool Paged Bytes",
  251. "Standby Cache Reserve Bytes",
  252. "Standby Cache Normal Priority Bytes",
  253. "Standby Cache Core Bytes",
  254.  
  255. ]
  256. # Use 6 x - to remove the Instance bit from the query.
  257. Instances = ["------"]
  258. Measurement = "win_mem"
  259. # Set to true to include _Total instance when querying for all (*).
  260. #IncludeTotal=false
  261.  
  262. [[inputs.win_perf_counters.object]]
  263. # Example query where the Instance portion must be removed to get data back,
  264. # such as from the Paging File object.
  265. ObjectName = "Paging File"
  266. Counters = [
  267. "% Usage",
  268. ]
  269. Instances = ["_Total"]
  270. Measurement = "win_swap"
  271.  
  272.  
  273. # Windows system plugins using WMI (disabled by default, using
  274. # win_perf_counters over WMI is recommended)
  275.  
  276.  
  277. # # Read metrics about cpu usage
  278. # [[inputs.cpu]]
  279. # ## Whether to report per-cpu stats or not
  280. # percpu = true
  281. # ## Whether to report total system cpu stats or not
  282. # totalcpu = true
  283. # ## If true, collect raw CPU time metrics.
  284. # collect_cpu_time = false
  285. # ## If true, compute and report the sum of all non-idle CPU states.
  286. # report_active = false
  287.  
  288.  
  289. # # Read metrics about disk usage by mount point
  290. # [[inputs.disk]]
  291. # ## By default stats will be gathered for all mount points.
  292. # ## Set mount_points will restrict the stats to only the specified mount points.
  293. # # mount_points = ["/"]
  294. #
  295. # ## Ignore mount points by filesystem type.
  296. # ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
  297.  
  298.  
  299. # # Read metrics about disk IO by device
  300. # [[inputs.diskio]]
  301. # ## By default, telegraf will gather stats for all devices including
  302. # ## disk partitions.
  303. # ## Setting devices will restrict the stats to the specified devices.
  304. # # devices = ["sda", "sdb", "vd*"]
  305. # ## Uncomment the following line if you need disk serial numbers.
  306. # # skip_serial_number = false
  307. # #
  308. # ## On systems which support it, device metadata can be added in the form of
  309. # ## tags.
  310. # ## Currently only Linux is supported via udev properties. You can view
  311. # ## available properties for a device by running:
  312. # ## 'udevadm info -q property -n /dev/sda'
  313. # # device_tags = ["ID_FS_TYPE", "ID_FS_USAGE"]
  314. # #
  315. # ## Using the same metadata source as device_tags, you can also customize the
  316. # ## name of the device via templates.
  317. # ## The 'name_templates' parameter is a list of templates to try and apply to
  318. # ## the device. The template may contain variables in the form of '$PROPERTY' or
  319. # ## '${PROPERTY}'. The first template which does not contain any variables not
  320. # ## present for the device is used as the device name tag.
  321. # ## The typical use case is for LVM volumes, to get the VG/LV name instead of
  322. # ## the near-meaningless DM-0 name.
  323. # # name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME"]
  324.  
  325.  
  326. # # Read metrics about memory usage
  327. # [[inputs.mem]]
  328. # # no configuration
  329.  
  330.  
  331. # # Read metrics about swap memory usage
  332. # [[inputs.swap]]
  333. # # no configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement