Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.58 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. # Global tags can be specified here in key="value" format.
  16. [global_tags]
  17. # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  18. # rack = "1a"
  19. ## Environment variables can be used as tags, and throughout the config file
  20. # user = "$USER"
  21. # Configuration for telegraf agent
  22. [agent]
  23. ## Default data collection interval for all inputs
  24. interval = "10s"
  25. ## Rounds collection interval to 'interval'
  26. ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
  27. round_interval = true
  28. ## Telegraf will send metrics to outputs in batches of at most
  29. ## metric_batch_size metrics.
  30. ## This controls the size of writes that Telegraf sends to output plugins.
  31. metric_batch_size = 1000
  32. ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
  33. ## output, and will flush this buffer on a successful write. Oldest metrics
  34. ## are dropped first when this buffer fills.
  35. ## This buffer only fills when writes fail to output plugin(s).
  36. metric_buffer_limit = 10000
  37. ## Collection jitter is used to jitter the collection by a random amount.
  38. ## Each plugin will sleep for a random time within jitter before collecting.
  39. ## This can be used to avoid many plugins querying things like sysfs at the
  40. ## same time, which can have a measurable effect on the system.
  41. collection_jitter = "0s"
  42. ## Default flushing interval for all outputs. You shouldn't set this below
  43. ## interval. Maximum flush_interval will be flush_interval + flush_jitter
  44. flush_interval = "10s"
  45. ## Jitter the flush interval by a random amount. This is primarily to avoid
  46. ## large write spikes for users running a large number of telegraf instances.
  47. ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
  48. flush_jitter = "0s"
  49. ## By default, precision will be set to the same timestamp order as the
  50. ## collection interval, with the maximum being 1s.
  51. ## Precision will NOT be used for service inputs, such as logparser and statsd.
  52. ## Valid values are "ns", "us" (or "ยตs"), "ms", "s".
  53. precision = ""
  54. ## Logging configuration:
  55. ## Run telegraf with debug log messages.
  56. # debug = true
  57. ## Run telegraf in quiet mode (error log messages only).
  58. quiet = false
  59. ## Specify the log file name. The empty string means to log to stderr.
  60. logfile = "/var/log/telegraf/telegraf.log"
  61. ## Override default hostname, if empty use os.Hostname()
  62. hostname = ""
  63. ## If set to true, do no set the "host" tag in the telegraf agent.
  64. omit_hostname = false
  65. ###############################################################################
  66. # OUTPUT PLUGINS #
  67. ###############################################################################
  68. # Configuration for influxdb server to send metrics to
  69. [[outputs.influxdb]]
  70. ## The full HTTP or UDP endpoint URL for your InfluxDB instance.
  71. ## Multiple urls can be specified as part of the same cluster,
  72. ## this means that only ONE of the urls will be written to each interval.
  73. urls = ["http://localhost:8086"] # required
  74. ## The target database for metrics (telegraf will create it if not exists).
  75.  
  76. database = "telegraf" # required
  77. ## Retention policy to write to. Empty string writes to the default rp.
  78. retention_policy = ""
  79. ## Write consistency (clusters only), can be: "any", "one", "quorum", "all"
  80. write_consistency = "any"
  81. ## Write timeout (for the InfluxDB client), formatted as a string.
  82. ## If not provided, will default to 5s. 0s means no timeout (not recommended).
  83. timeout = "5s"
  84. username = "admin"
  85. password = "admin"
  86.  
  87. ## Set the user agent for HTTP POSTs (can be useful for log differentiation)
  88. user_agent = "telegraf"
  89. ###############################################################################
  90. # PROCESSOR PLUGINS #
  91. ###############################################################################
  92. # # Print all metrics that pass through this filter.
  93. # [[processors.printer]]
  94. ###############################################################################
  95. # AGGREGATOR PLUGINS #
  96. ###############################################################################
  97. # # Keep the aggregate min/max of each metric passing through.
  98. # [[aggregators.minmax]]
  99. # ## General Aggregator Arguments:
  100. # ## The period on which to flush & clear the aggregator.
  101. # period = "30s"
  102. # ## If true, the original metric will be dropped by the
  103. # ## aggregator and will not get sent to the output plugins.
  104. # drop_original = false
  105. # Telegraf Configuration for UniFi UAP monitoring via SNMP
  106. # These input configurations are required for use with the dashboard
  107. # Edit the list of monitored hosts ("agents")
  108. # and SNMP community string ("community") as appropriate.
  109. ###############################################################################
  110. # INPUT PLUGINS #
  111. ###############################################################################
  112. ##
  113. ## Retrieves details via SNMP from remote agents
  114. ##
  115. ##
  116. ## UniFi APs (Gen 2/Gen 3)
  117. ##
  118. [[inputs.snmp]]
  119. # List of agents to poll
  120.  
  121. agents = [ "ip-ap-1", "ip-ap-2" ]
  122.  
  123. # Polling interval
  124. interval = "60s"
  125. # Timeout for each SNMP query.
  126. timeout = "10s"
  127. # Number of retries to attempt within timeout.
  128. retries = 3
  129. # SNMP version, UAP only supports v1
  130. version = 1
  131. # SNMP community string.
  132.  
  133. community = "public"
  134.  
  135. # The GETBULK max-repetitions parameter
  136. max_repetitions = 10
  137. # Measurement name
  138. name = "snmp.UAP"
  139. ##
  140. ## System Details
  141. ##
  142. # System name (hostname)
  143. [[inputs.snmp.field]]
  144. is_tag = true
  145. name = "sysName"
  146. oid = "RFC1213-MIB::sysName.0"
  147. # System vendor OID
  148. [[inputs.snmp.field]]
  149. name = "sysObjectID"
  150. oid = "RFC1213-MIB::sysObjectID.0"
  151. # System description
  152. [[inputs.snmp.field]]
  153. name = "sysDescr"
  154. oid = "RFC1213-MIB::sysDescr.0"
  155. # System contact
  156. [[inputs.snmp.field]]
  157. name = "sysContact"
  158. oid = "RFC1213-MIB::sysContact.0"
  159. # System location
  160. [[inputs.snmp.field]]
  161. name = "sysLocation"
  162. oid = "RFC1213-MIB::sysLocation.0"
  163. # System uptime
  164. [[inputs.snmp.field]]
  165. name = "sysUpTime"
  166. oid = "RFC1213-MIB::sysUpTime.0"
  167. # UAP model
  168. [[inputs.snmp.field]]
  169. name = "unifiApSystemModel"
  170. oid = "UBNT-UniFi-MIB::unifiApSystemModel"
  171. # UAP firmware version
  172. [[inputs.snmp.field]]
  173. name = "unifiApSystemVersion"
  174. oid = "UBNT-UniFi-MIB::unifiApSystemVersion"
  175. ##
  176. ## Host Resources
  177. ##
  178. # Total memory
  179. [[inputs.snmp.field]]
  180. name = "memTotal"
  181. oid = "FROGFOOT-RESOURCES-MIB::memTotal.0"
  182. # Free memory
  183. [[inputs.snmp.field]]
  184. name = "memFree"
  185. oid = "FROGFOOT-RESOURCES-MIB::memFree.0"
  186. # Buffer memory
  187. [[inputs.snmp.field]]
  188. name = "memBuffer"
  189. oid = "FROGFOOT-RESOURCES-MIB::memBuffer.0"
  190. # Cache memory
  191. [[inputs.snmp.field]]
  192. name = "memCache"
  193. oid = "FROGFOOT-RESOURCES-MIB::memCache.0"
  194. # Per-interface traffic, errors, drops
  195. [[inputs.snmp.table]]
  196. oid = "IF-MIB::ifTable"
  197. [[inputs.snmp.table.field]]
  198. is_tag = true
  199. oid = "IF-MIB::ifDescr"
  200. ##
  201. ## Interface Details & Metrics
  202. ##
  203. # Wireless interfaces
  204. [[inputs.snmp.table]]
  205. oid = "UBNT-UniFi-MIB::unifiRadioTable"
  206. [[inputs.snmp.table.field]]
  207. is_tag = true
  208. oid = "UBNT-UniFi-MIB::unifiRadioName"
  209. [[inputs.snmp.table.field]]
  210. is_tag = true
  211. oid = "UBNT-UniFi-MIB::unifiRadioRadio"
  212. # BSS instances
  213. [[inputs.snmp.table]]
  214. oid = "UBNT-UniFi-MIB::unifiVapTable"
  215. [[inputs.snmp.table.field]]
  216. is_tag = true
  217. oid = "UBNT-UniFi-MIB::unifiVapName"
  218. [[inputs.snmp.table.field]]
  219. is_tag = true
  220. oid = "UBNT-UniFi-MIB::unifiVapRadio"
  221. # Ethernet interfaces
  222. [[inputs.snmp.table]]
  223. oid = "UBNT-UniFi-MIB::unifiIfTable"
  224. [[inputs.snmp.table.field]]
  225. is_tag = true
  226. oid = "UBNT-UniFi-MIB::unifiIfName"
  227. ##
  228. ## System Performance
  229. ##
  230. # System load averages
  231. [[inputs.snmp.table]]
  232. oid = "FROGFOOT-RESOURCES-MIB::loadTable"
  233. [[inputs.snmp.table.field]]
  234. is_tag = true
  235. oid = "FROGFOOT-RESOURCES-MIB::loadDescr"
  236. ##
  237. ## SNMP metrics
  238. ##
  239. # Number of SNMP messages received
  240. [[inputs.snmp.field]]
  241. name = "snmpInPkts"
  242. oid = "SNMPv2-MIB::snmpInPkts.0"
  243. # Number of SNMP Get-Request received
  244. [[inputs.snmp.field]]
  245. name = "snmpInGetRequests"
  246. oid = "SNMPv2-MIB::snmpInGetRequests.0"
  247. # Number of SNMP Get-Next received
  248. [[inputs.snmp.field]]
  249. name = "snmpInGetNexts"
  250. oid = "SNMPv2-MIB::snmpInGetNexts.0"
  251. # Number of SNMP objects requested
  252. [[inputs.snmp.field]]
  253. name = "snmpInTotalReqVars"
  254. oid = "SNMPv2-MIB::snmpInTotalReqVars.0"
  255. # Number of SNMP Get-Response received
  256. [[inputs.snmp.field]]
  257. name = "snmpInGetResponses"
  258. oid = "SNMPv2-MIB::snmpInGetResponses.0"
  259. # Number of SNMP messages sent
  260. [[inputs.snmp.field]]
  261. name = "snmpOutPkts"
  262. oid = "SNMPv2-MIB::snmpOutPkts.0"
  263. # Number of SNMP Get-Request sent
  264. [[inputs.snmp.field]]
  265. name = "snmpOutGetRequests"
  266. oid = "SNMPv2-MIB::snmpOutGetRequests.0"
  267. # Number of SNMP Get-Next sent
  268. [[inputs.snmp.field]]
  269. name = "snmpOutGetNexts"
  270. oid = "SNMPv2-MIB::snmpOutGetNexts.0"
  271. # Number of SNMP Get-Response sent
  272. [[inputs.snmp.field]]
  273. name = "snmpOutGetResponses"
  274. oid = "SNMPv2-MIB::snmpOutGetResponses.0"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement