Инструменты пользователя

Инструменты сайта


linux:metrics

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
linux:metrics [2023/10/30 12:59]
admin
linux:metrics [2023/11/05 06:05] (текущий)
admin [Мониторинг ZFS]
Строка 12: Строка 12:
  
    # Либо есть в тех же репозиториях что и influxdb    # Либо есть в тех же репозиториях что и influxdb
-sudo tee /etc/yum.repos.d/influxdb.repo<<EOF +cat <<EOF | sudo tee /etc/yum.repos.d/influxdata.repo 
-[influxdb+[influxdata
-name = InfluxDB Repository +name = InfluxData Repository - Stable 
-baseurl = https://repos.influxdata.com/rhel/8/x86_64/stable/+baseurl = https://repos.influxdata.com/stable/\$basearch/main
 enabled = 1 enabled = 1
 gpgcheck = 1 gpgcheck = 1
-gpgkey = https://repos.influxdata.com/influxdb.key+gpgkey = https://repos.influxdata.com/influxdata-archive_compat.key
 EOF EOF
  
Строка 58: Строка 58:
  
 <code bash> <code bash>
-# Use 'telegraf -config telegraf.conf -test' to see what metrics a config 
-# file would generate. 
- 
-# Global tags can be specified here in key="value" format. 
 [global_tags] [global_tags]
-  # dc = "us-east-1" # will tag all metrics with dc=us-east-1 
-  # rack = "1a" 
- 
-# Configuration for telegraf agent 
 [agent] [agent]
-  ## Default data collection interval for all inputs 
   interval = "60s"   interval = "60s"
-  ## Rounds collection interval to 'interval' 
-  ## ie, if interval="10s" then always collect on :00, :10, :20, etc. 
   round_interval = true   round_interval = true
- 
-  ## Telegraf will cache metric_buffer_limit metrics for each output, and will 
-  ## flush this buffer on a successful write. 
   metric_buffer_limit = 1000   metric_buffer_limit = 1000
-  ## Flush the buffer whenever full, regardless of flush_interval. 
   flush_buffer_when_full = true   flush_buffer_when_full = true
- 
-  ## Collection jitter is used to jitter the collection by a random amount. 
-  ## Each plugin will sleep for a random time within jitter before collecting. 
-  ## This can be used to avoid many plugins querying things like sysfs at the 
-  ## same time, which can have a measurable effect on the system. 
   collection_jitter = "0s"   collection_jitter = "0s"
- 
-  ## Default flushing interval for all outputs. You shouldn't set this below 
-  ## interval. Maximum flush_interval will be flush_interval + flush_jitter 
   flush_interval = "10s"   flush_interval = "10s"
-  ## Jitter the flush interval by a random amount. This is primarily to avoid 
-  ## large write spikes for users running a large number of telegraf instances. 
-  ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s 
   flush_jitter = "0s"   flush_jitter = "0s"
 + 
   ## Logging configuration:   ## Logging configuration:
-  ## Run telegraf in debug mode 
   debug = false   debug = false
-  ## Run telegraf in quiet mode 
   quiet = false   quiet = false
-  ## Specify the log file name. The empty string means to log to stdout. 
   logfile = "C:/Program Files/Telegraf/telegraf.log"   logfile = "C:/Program Files/Telegraf/telegraf.log"
- + 
-  ## Override default hostname, if empty use os.Hostname()+
   hostname = ""   hostname = ""
- +  
 + 
 ############################################################################### ###############################################################################
 #                                  OUTPUTS                                    # #                                  OUTPUTS                                    #
 ############################################################################### ###############################################################################
- + 
-# Configuration for influxdb server to send metrics to+
 [[outputs.influxdb]] [[outputs.influxdb]]
-  # The full HTTP or UDP endpoint URL for your InfluxDB instance. 
-  # Multiple urls can be specified but it is assumed that they are part of the same 
-  # cluster, this means that only ONE of the urls will be written to each interval. 
-  # urls = ["udp://localhost:8089"] # UDP endpoint example 
   urls = ["http://:8086"] # required   urls = ["http://:8086"] # required
-  # The target database for metrics (telegraf will create it if not exists) 
   database = "telegraf" # required   database = "telegraf" # required
-  # Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h". 
-  # note: using second precision greatly helps InfluxDB compression 
   precision = "s"   precision = "s"
   retention_policy = ""   retention_policy = ""
-  ## Write timeout (for the InfluxDB client), formatted as a string. 
-  ## If not provided, will default to 5s. 0s means no timeout (not recommended). 
   timeout = "10s"   timeout = "10s"
   username = ""   username = ""
   password = ""   password = ""
-  # Set the user agent for HTTP POSTs (can be useful for log differentiation) +
-  # user_agent = "telegraf" +
-  # Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes) +
-  # udp_payload = 512+
  
  
Строка 329: Строка 286:
 </code> </code>
 </details> </details>
 +
 +
 +
 +==== Мониторинг ZFS ====
 +
 +<details>
 +<summary>:!: Плагин для ZFS</summary>
 +[[https://github.com/influxdata/telegraf/blob/master/plugins/inputs/zfs/README.md|Doc]]\\
 +
 +Добавялем в конфиг, собсна достаточно с параметрами по умолчанию\\
 +Данные берутся из "/proc/spl/kstat/zfs"\\
 +<code bash>
 +[[inputs.zfs]]
 +
 +</code>
 +</details>
 +
 +
 +<details>
 +<summary>:!: Публикация в Prometheus </summary>
 +[[https://github.com/influxdata/telegraf/blob/master/plugins/outputs/prometheus_client/README.md|Doc]]\\
 +По некоторым причинам удобнее метрики передавать (настраивать в графане) через прометеус\\
 +Есть модуль который публикует содержимое телеграфа в формате прометеуса, в веб-страницу\\
 +Добавляем блок "output" в конфиг:\\
 +<code bash>
 +[[outputs.prometheus_client]]
 +  listen = ":9273"
 +  string_as_label = true
 +  metric_version = 2
 +</code>
 +</details>
 +
 +
 +
 +
 +
 +
 +<details>
 +<summary> </summary>
 +
 +<code bash>
 +
 +</code>
 +</details>
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
linux/metrics.1698670763.txt.gz · Последнее изменение: 2023/10/30 12:59 — admin