Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| serveurs:installation:web-srv:docker-telegraf [2023/05/31 08:57] – [Exemple de fichier telegraf.conf complet] jpmilcent | serveurs:installation:web-srv:docker-telegraf [2023/06/01 13:58] (Version actuelle) – supprimée jpmilcent | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Installer l' | ||
| - | * Se connecter en tant qu' | ||
| - | * Se placer dans le dossier : '' | ||
| - | * Lancer le container afin d' | ||
| - | * Corriger les éventuels problèmes de configuration de Telegraf s' | ||
| - | * Lorsque tout fonctionne correctement, | ||
| - | ===== Monitorer différents services spécifiques ===== | ||
| - | * Nginx: | ||
| - | * status | ||
| - | * access log | ||
| - | * Postgresql : | ||
| - | * Gunicorn : [[serveurs: | ||
| - | |||
| - | ===== Exemple de fichier telegraf.conf complet ===== | ||
| - | Exemple avec : | ||
| - | * le support d' | ||
| - | * le statut de Nginx, | ||
| - | * l' | ||
| - | * la surveillance de Postgresql | ||
| - | * la surveillance des service du système à l'aide du script // | ||
| - | <code python> | ||
| - | # Telegraf Configuration | ||
| - | [global_tags] | ||
| - | |||
| - | [agent] | ||
| - | interval = " | ||
| - | round_interval = true | ||
| - | metric_batch_size = 1000 | ||
| - | metric_buffer_limit = 10000 | ||
| - | collection_jitter = " | ||
| - | flush_interval = " | ||
| - | flush_jitter = " | ||
| - | precision = "" | ||
| - | hostname = "" | ||
| - | omit_hostname = false | ||
| - | # Set to true to debug this config file ! | ||
| - | debug = false | ||
| - | |||
| - | [[outputs.influxdb_v2]] | ||
| - | urls = [" | ||
| - | ## Token for authentication. | ||
| - | token = " | ||
| - | ## Organization is the name of the organization you wish to write to. | ||
| - | organization = " | ||
| - | ## Destination bucket to write into. | ||
| - | bucket = " | ||
| - | |||
| - | [[inputs.conntrack]] | ||
| - | files = [" | ||
| - | dirs = ["/ | ||
| - | |||
| - | [[inputs.cpu]] | ||
| - | percpu = true | ||
| - | totalcpu = true | ||
| - | collect_cpu_time = false | ||
| - | report_active = false | ||
| - | |||
| - | [[inputs.disk]] | ||
| - | mount_points = ["/ | ||
| - | ignore_fs = [" | ||
| - | |||
| - | # Monitoring of instance devices | ||
| - | # WARNING : see distinct devices in /dev with `df -h` | ||
| - | [[inputs.diskio]] | ||
| - | devices = [" | ||
| - | |||
| - | [[inputs.docker]] | ||
| - | endpoint = " | ||
| - | gather_services = false | ||
| - | container_name_include = [] | ||
| - | container_name_exclude = [] | ||
| - | timeout = " | ||
| - | perdevice = false | ||
| - | perdevice_include = [" | ||
| - | total_include = [" | ||
| - | docker_label_include = [] | ||
| - | docker_label_exclude = [] | ||
| - | |||
| - | # Monitoring of Systemd services with help of Srvstatus scripts | ||
| - | [[inputs.exec]] | ||
| - | commands = [ | ||
| - | "cat / | ||
| - | ] | ||
| - | timeout = " | ||
| - | name_override = " | ||
| - | data_format = " | ||
| - | tag_keys = [ | ||
| - | " | ||
| - | ] | ||
| - | |||
| - | [[inputs.internal]] | ||
| - | |||
| - | [[inputs.interrupts]] | ||
| - | cpu_as_tag = true | ||
| - | [inputs.interrupts.tagdrop] | ||
| - | irq = [" | ||
| - | |||
| - | [[inputs.kernel]] | ||
| - | |||
| - | [[inputs.linux_sysctl_fs]] | ||
| - | |||
| - | [[inputs.mem]] | ||
| - | |||
| - | [[inputs.net]] | ||
| - | |||
| - | [[inputs.netstat]] | ||
| - | |||
| - | # Monitoring of Nginx current status | ||
| - | [[inputs.nginx]] | ||
| - | urls = [" | ||
| - | response_timeout = " | ||
| - | |||
| - | [[inputs.nstat]] | ||
| - | proc_net_netstat = "/ | ||
| - | proc_net_snmp = "/ | ||
| - | proc_net_snmp6 = "/ | ||
| - | dump_zeros = true | ||
| - | |||
| - | [[inputs.postgresql]] | ||
| - | address = " | ||
| - | outputaddress=" | ||
| - | max_lifetime = " | ||
| - | databases = [" | ||
| - | |||
| - | [[inputs.processes]] | ||
| - | |||
| - | # Monitoring of Gunicorn for GeoNature, UsersHub, TaxHub and Atlas. | ||
| - | [[inputs.statsd]] | ||
| - | protocol = " | ||
| - | max_tcp_connections = 250 | ||
| - | tcp_keep_alive = false | ||
| - | service_address = ": | ||
| - | delete_gauges = true | ||
| - | delete_counters = true | ||
| - | delete_sets = true | ||
| - | delete_timings = true | ||
| - | percentiles = [50.0, 90.0, 99.0, 99.9, 99.95, 100.0] | ||
| - | metric_separator = " | ||
| - | parse_data_dog_tags = false | ||
| - | datadog_extensions = false | ||
| - | allowed_pending_messages = 10000 | ||
| - | percentile_limit = 1000 | ||
| - | |||
| - | [[inputs.swap]] | ||
| - | |||
| - | [[inputs.system]] | ||
| - | |||
| - | # Nginx access log monitoring | ||
| - | [[inputs.tail]] | ||
| - | files = ["/ | ||
| - | data_format = " | ||
| - | grok_timezone = " | ||
| - | from_beginning = true | ||
| - | name_override = " | ||
| - | grok_patterns = [" | ||
| - | # Grock : https:// | ||
| - | # Grock pattern : https:// | ||
| - | # Ex : https:// | ||
| - | grok_custom_patterns = ''' | ||
| - | CUSTOM_LOG_FORMAT %{IPORHOST: | ||
| - | ''' | ||
| - | |||
| - | # WARNING : only for debugging | ||
| - | # | ||
| - | # namepass = [" | ||
| - | # files = ["/ | ||
| - | # influx_sort_fields = true | ||
| - | </ | ||