Advertisement
fcoafonso

Telegraf for Win

Jan 22nd, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.43 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 surround
  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. ## Maximum number of unwritten metrics per output. Increasing this value
  39. ## allows for longer periods of output downtime without dropping metrics at the
  40. ## cost of higher maximum memory usage.
  41. metric_buffer_limit = 10000
  42.  
  43. ## Collection jitter is used to jitter the collection by a random amount.
  44. ## Each plugin will sleep for a random time within jitter before collecting.
  45. ## This can be used to avoid many plugins querying things like sysfs at the
  46. ## same time, which can have a measurable effect on the system.
  47. collection_jitter = "0s"
  48.  
  49. ## Default flushing interval for all outputs. Maximum flush_interval will be
  50. ## flush_interval + flush_jitter
  51. flush_interval = "10s"
  52. ## Jitter the flush interval by a random amount. This is primarily to avoid
  53. ## large write spikes for users running a large number of telegraf instances.
  54. ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  55. flush_jitter = "0s"
  56.  
  57. ## By default or when set to "0s", precision will be set to the same
  58. ## timestamp order as the collection interval, with the maximum being 1s.
  59. ## ie, when interval = "10s", precision will be "1s"
  60. ## when interval = "250ms", precision will be "1ms"
  61. ## Precision will NOT be used for service inputs. It is up to each individual
  62. ## service input to set the timestamp at the appropriate precision.
  63. ## Valid time units are "ns", "us" (or "µs"), "ms", "s".
  64. precision = ""
  65.  
  66. ## Log at debug level.
  67. # debug = false
  68. ## Log only error level messages.
  69. # quiet = false
  70.  
  71. ## Log target controls the destination for logs and can be one of "file",
  72. ## "stderr" or, on Windows, "eventlog". When set to "file", the output file
  73. ## is determined by the "logfile" setting.
  74. # logtarget = "file"
  75.  
  76. ## Name of the file to be logged to when using the "file" logtarget. If set to
  77. ## the empty string then logs are written to stderr.
  78. # logfile = ""
  79.  
  80. ## The logfile will be rotated after the time interval specified. When set
  81. ## to 0 no time based rotation is performed. Logs are rotated only when
  82. ## written to, if there is no log activity rotation may be delayed.
  83. # logfile_rotation_interval = "0d"
  84.  
  85. ## The logfile will be rotated when it becomes larger than the specified
  86. ## size. When set to 0 no size based rotation is performed.
  87. # logfile_rotation_max_size = "0MB"
  88.  
  89. ## Maximum number of rotated archives to keep, any older logs are deleted.
  90. ## If set to -1, no archives are removed.
  91. # logfile_rotation_max_archives = 5
  92.  
  93. ## Override default hostname, if empty use os.Hostname()
  94. hostname = ""
  95. ## If set to true, do no set the "host" tag in the telegraf agent.
  96. omit_hostname = false
  97.  
  98.  
  99. ###############################################################################
  100. # OUTPUT PLUGINS #
  101. ###############################################################################
  102.  
  103.  
  104. # Configuration for sending metrics to InfluxDB
  105. [[outputs.influxdb]]
  106. ## The full HTTP or UDP URL for your InfluxDB instance.
  107. ##
  108. ## Multiple URLs can be specified for a single cluster, only ONE of the
  109. ## urls will be written to each interval.
  110. # urls = ["unix:///var/run/influxdb.sock"]
  111. # urls = ["udp://127.0.0.1:8089"]
  112. urls = ["http://10.0.0.194:8086"]
  113.  
  114. ## The target database for metrics; will be created as needed.
  115. ## For UDP url endpoint database needs to be configured on server side.
  116. database = "telegraf"
  117.  
  118. ## The value of this tag will be used to determine the database. If this
  119. ## tag is not set the 'database' option is used as the default.
  120. # database_tag = ""
  121.  
  122. ## If true, the database tag will not be added to the metric.
  123. # exclude_database_tag = false
  124.  
  125. ## If true, no CREATE DATABASE queries will be sent. Set to true when using
  126. ## Telegraf with a user without permissions to create databases or when the
  127. ## database already exists.
  128. # skip_database_creation = false
  129.  
  130. ## Name of existing retention policy to write to. Empty string writes to
  131. ## the default retention policy. Only takes effect when using HTTP.
  132. # retention_policy = ""
  133.  
  134. ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  135. ## Only takes effect when using HTTP.
  136. # write_consistency = "any"
  137.  
  138. ## Timeout for HTTP messages.
  139. timeout = "5s"
  140.  
  141. ## HTTP Basic Auth
  142. username = "monitor"
  143. password = "monitor"
  144.  
  145. ## HTTP User-Agent
  146. # user_agent = "telegraf"
  147.  
  148. ## UDP payload size is the maximum packet size to send.
  149. # udp_payload = "512B"
  150.  
  151. ## Optional TLS Config for use on HTTP connections.
  152. # tls_ca = "/etc/telegraf/ca.pem"
  153. # tls_cert = "/etc/telegraf/cert.pem"
  154. # tls_key = "/etc/telegraf/key.pem"
  155. ## Use TLS but skip chain & host verification
  156. # insecure_skip_verify = false
  157.  
  158. ## HTTP Proxy override, if unset values the standard proxy environment
  159. ## variables are consulted to determine which proxy, if any, should be used.
  160. # http_proxy = "http://corporate.proxy:3128"
  161.  
  162. ## Additional HTTP headers
  163. # http_headers = {"X-Special-Header" = "Special-Value"}
  164.  
  165. ## HTTP Content-Encoding for write request body, can be set to "gzip" to
  166. ## compress body or "identity" to apply no encoding.
  167. # content_encoding = "identity"
  168.  
  169. ## When true, Telegraf will output unsigned integers as unsigned values,
  170. ## i.e.: "42u". You will need a version of InfluxDB supporting unsigned
  171. ## integer values. Enabling this option will result in field type errors if
  172. ## existing data has been written.
  173. # influx_uint_support = false
  174.  
  175. # # Configuration for sending metrics to InfluxDB
  176. # [[outputs.influxdb_v2]]
  177. # ## The URLs of the InfluxDB cluster nodes.
  178. # ##
  179. # ## Multiple URLs can be specified for a single cluster, only ONE of the
  180. # ## urls will be written to each interval.
  181. # ## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
  182. # urls = ["http://127.0.0.1:9999"]
  183. #
  184. # ## Token for authentication.
  185. # token = ""
  186. #
  187. # ## Organization is the name of the organization you wish to write to; must exist.
  188. # organization = ""
  189. #
  190. # ## Destination bucket to write into.
  191. # bucket = ""
  192. #
  193. # ## The value of this tag will be used to determine the bucket. If this
  194. # ## tag is not set the 'bucket' option is used as the default.
  195. # # bucket_tag = ""
  196. #
  197. # ## If true, the bucket tag will not be added to the metric.
  198. # # exclude_bucket_tag = false
  199. #
  200. # ## Timeout for HTTP messages.
  201. # # timeout = "5s"
  202. #
  203. # ## Additional HTTP headers
  204. # # http_headers = {"X-Special-Header" = "Special-Value"}
  205. #
  206. # ## HTTP Proxy override, if unset values the standard proxy environment
  207. # ## variables are consulted to determine which proxy, if any, should be used.
  208. # # http_proxy = "http://corporate.proxy:3128"
  209. #
  210. # ## HTTP User-Agent
  211. # # user_agent = "telegraf"
  212. #
  213. # ## Content-Encoding for write request body, can be set to "gzip" to
  214. # ## compress body or "identity" to apply no encoding.
  215. # # content_encoding = "gzip"
  216. #
  217. # ## Enable or disable uint support for writing uints influxdb 2.0.
  218. # # influx_uint_support = false
  219. #
  220. # ## Optional TLS Config for use on HTTP connections.
  221. # # tls_ca = "/etc/telegraf/ca.pem"
  222. # # tls_cert = "/etc/telegraf/cert.pem"
  223. # # tls_key = "/etc/telegraf/key.pem"
  224. # ## Use TLS but skip chain & host verification
  225. # # insecure_skip_verify = false
  226.  
  227.  
  228. ###############################################################################
  229. # INPUT PLUGINS #
  230. ###############################################################################
  231.  
  232.  
  233. # Windows Performance Counters plugin.
  234. # These are the recommended method of monitoring system metrics on windows,
  235. # as the regular system plugins (inputs.cpu, inputs.mem, etc.) rely on WMI,
  236. # which utilize more system resources.
  237. #
  238. # See more configuration examples at:
  239. # https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters
  240.  
  241. [[inputs.win_perf_counters]]
  242. [[inputs.win_perf_counters.object]]
  243. # Processor usage, alternative to native, reports on a per core.
  244. ObjectName = "Processor"
  245. Instances = ["*"]
  246. Counters = [
  247. "% Idle Time",
  248. "% Interrupt Time",
  249. "% Privileged Time",
  250. "% User Time",
  251. "% Processor Time",
  252. "% DPC Time",
  253. ]
  254. Measurement = "win_cpu"
  255. # Set to true to include _Total instance when querying for all (*).
  256. IncludeTotal=true
  257.  
  258. [[inputs.win_perf_counters.object]]
  259. # Disk times and queues
  260. ObjectName = "LogicalDisk"
  261. Instances = ["*"]
  262. Counters = [
  263. "% Idle Time",
  264. "% Disk Time",
  265. "% Disk Read Time",
  266. "% Disk Write Time",
  267. "% Free Space",
  268. "Current Disk Queue Length",
  269. "Free Megabytes",
  270. ]
  271. Measurement = "win_disk"
  272. # Set to true to include _Total instance when querying for all (*).
  273. #IncludeTotal=false
  274.  
  275. [[inputs.win_perf_counters.object]]
  276. ObjectName = "PhysicalDisk"
  277. Instances = ["*"]
  278. Counters = [
  279. "Disk Read Bytes/sec",
  280. "Disk Write Bytes/sec",
  281. "Current Disk Queue Length",
  282. "Disk Reads/sec",
  283. "Disk Writes/sec",
  284. "% Disk Time",
  285. "% Disk Read Time",
  286. "% Disk Write Time",
  287. ]
  288. Measurement = "win_diskio"
  289.  
  290. [[inputs.win_perf_counters.object]]
  291. ObjectName = "Network Interface"
  292. Instances = ["*"]
  293. Counters = [
  294. "Bytes Received/sec",
  295. "Bytes Sent/sec",
  296. "Packets Received/sec",
  297. "Packets Sent/sec",
  298. "Packets Received Discarded",
  299. "Packets Outbound Discarded",
  300. "Packets Received Errors",
  301. "Packets Outbound Errors",
  302. ]
  303. Measurement = "win_net"
  304.  
  305. [[inputs.win_perf_counters.object]]
  306. ObjectName = "System"
  307. Counters = [
  308. "Context Switches/sec",
  309. "System Calls/sec",
  310. "Processor Queue Length",
  311. "System Up Time",
  312. "Processes",
  313. "Threads",
  314. ]
  315. Instances = ["------"]
  316. Measurement = "win_system"
  317. # Set to true to include _Total instance when querying for all (*).
  318. #IncludeTotal=false
  319.  
  320. [[inputs.win_perf_counters.object]]
  321. # Example query where the Instance portion must be removed to get data back,
  322. # such as from the Memory object.
  323. ObjectName = "Memory"
  324. Counters = [
  325. "Available Bytes",
  326. "Cache Faults/sec",
  327. "Demand Zero Faults/sec",
  328. "Page Faults/sec",
  329. "Pages/sec",
  330. "Transition Faults/sec",
  331. "Pool Nonpaged Bytes",
  332. "Pool Paged Bytes",
  333. "Standby Cache Reserve Bytes",
  334. "Standby Cache Normal Priority Bytes",
  335. "Standby Cache Core Bytes",
  336. ]
  337. # Use 6 x - to remove the Instance bit from the query.
  338. Instances = ["------"]
  339. Measurement = "win_mem"
  340. # Set to true to include _Total instance when querying for all (*).
  341. #IncludeTotal=false
  342.  
  343. [[inputs.win_perf_counters.object]]
  344. # Example query where the Instance portion must be removed to get data back,
  345. # such as from the Paging File object.
  346. ObjectName = "Paging File"
  347. Counters = [
  348. "% Usage",
  349. ]
  350. Instances = ["_Total"]
  351. Measurement = "win_swap"
  352.  
  353. ###################################
  354. # Personalizados #
  355. ###################################
  356. [[inputs.win_perf_counters.object]]
  357. # Example query where the Instance portion must be removed to get data back,
  358. # such as from the Paging File object.
  359. ObjectName = "Process"
  360. Counters = [
  361. "% Processor Time",
  362. "Handle Count",
  363. "Private Bytes",
  364. "Virtual Bytes",
  365. "Working Set",
  366. ]
  367. Instances = ["*"]
  368. Measurement = "win_proc"
  369.  
  370.  
  371. [[inputs.win_services]]
  372. ## Names of the services to monitor. Leave empty to monitor all the available services on the host
  373. service_names = [
  374. "LanmanServer",
  375. "TermService",
  376. "Spooler",
  377. ]
  378.  
  379. # Windows system plugins using WMI (disabled by default, using
  380. # win_perf_counters over WMI is recommended)
  381.  
  382.  
  383. # # Read metrics about cpu usage
  384. # [[inputs.cpu]]
  385. # ## Whether to report per-cpu stats or not
  386. # percpu = true
  387. # ## Whether to report total system cpu stats or not
  388. # totalcpu = true
  389. # ## If true, collect raw CPU time metrics.
  390. # collect_cpu_time = false
  391. # ## If true, compute and report the sum of all non-idle CPU states.
  392. # report_active = false
  393.  
  394.  
  395. # # Read metrics about disk usage by mount point
  396. # [[inputs.disk]]
  397. # ## By default stats will be gathered for all mount points.
  398. # ## Set mount_points will restrict the stats to only the specified mount points.
  399. # # mount_points = ["/"]
  400. #
  401. # ## Ignore mount points by filesystem type.
  402. # ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
  403.  
  404.  
  405. # # Read metrics about disk IO by device
  406. # [[inputs.diskio]]
  407. # ## By default, telegraf will gather stats for all devices including
  408. # ## disk partitions.
  409. # ## Setting devices will restrict the stats to the specified devices.
  410. # # devices = ["sda", "sdb", "vd*"]
  411. # ## Uncomment the following line if you need disk serial numbers.
  412. # # skip_serial_number = false
  413. # #
  414. # ## On systems which support it, device metadata can be added in the form of
  415. # ## tags.
  416. # ## Currently only Linux is supported via udev properties. You can view
  417. # ## available properties for a device by running:
  418. # ## 'udevadm info -q property -n /dev/sda'
  419. # # device_tags = ["ID_FS_TYPE", "ID_FS_USAGE"]
  420. # #
  421. # ## Using the same metadata source as device_tags, you can also customize the
  422. # ## name of the device via templates.
  423. # ## The 'name_templates' parameter is a list of templates to try and apply to
  424. # ## the device. The template may contain variables in the form of '$PROPERTY' or
  425. # ## '${PROPERTY}'. The first template which does not contain any variables not
  426. # ## present for the device is used as the device name tag.
  427. # ## The typical use case is for LVM volumes, to get the VG/LV name instead of
  428. # ## the near-meaningless DM-0 name.
  429. # # name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME"]
  430.  
  431.  
  432. # # Read metrics about memory usage
  433. # [[inputs.mem]]
  434. # # no configuration
  435.  
  436.  
  437. # # Read metrics about swap memory usage
  438. # [[inputs.swap]]
  439. # # no configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement