diff --git a/playbook_staging.yml b/playbook_staging.yml index 80b9b2b..7901797 100644 --- a/playbook_staging.yml +++ b/playbook_staging.yml @@ -10,7 +10,7 @@ --- - hosts: pp.visio.nereide.fr roles: - - role: jitsi-add-logo + - role: jitsi-enable-stats tags: - ppnrd diff --git a/roles/jitsi-enable-stats/tasks/main.yml b/roles/jitsi-enable-stats/tasks/main.yml index 5fc1018..8aef7e5 100644 --- a/roles/jitsi-enable-stats/tasks/main.yml +++ b/roles/jitsi-enable-stats/tasks/main.yml @@ -41,7 +41,28 @@ - name: Application de la conf Jitsi pour Telegraf template: - src: ../files/jitsi.conf - dest: /etc/telegraf/telegraf.d/ + src: ../templates/telegraf-input-jitsi.conf + dest: /etc/telegraf/telegraf.d/jitsi.conf notify: - restart telegraf + +- name: Question + pause: + prompt: "Vers quel influxdb/grafana souhaitez vous envoyer les metrics?\n1- Néréide\n2- Champs-Libres\n" + register: prompt_input + +- name: Application de la conf Telegraf Néréide + template: + src: ../templates/telegraf-general-nrd.conf.j2 + dest: /etc/telegraf/telegraf.conf + notify: + - restart telegraf + when: ( prompt_input.user_input == "1" ) + +- name: Application de la conf Telegraf Champs-Libre + template: + src: ../templates/telegraf-general-cl.conf.j2 + dest: /etc/telegraf/telegraf.conf + notify: + - restart telegraf + when: ( prompt_input.user_input == "2" ) diff --git a/roles/jitsi-enable-stats/templates/telegraf-general-cl.conf.j2 b/roles/jitsi-enable-stats/templates/telegraf-general-cl.conf.j2 new file mode 100644 index 0000000..340e966 --- /dev/null +++ b/roles/jitsi-enable-stats/templates/telegraf-general-cl.conf.j2 @@ -0,0 +1,42 @@ +[global_tags] + + +# Configuration for telegraf agent +[agent] + interval = "60s" + debug = false + hostname = "{{ inventory_hostname }}" + round_interval = true + flush_interval = "10s" + flush_jitter = "0s" + collection_jitter = "0s" + metric_batch_size = 1000 + metric_buffer_limit = 10000 + quiet = false + logfile = "" + omit_hostname = false + +############################################################################### +# OUTPUTS # +############################################################################### + +[[outputs.influxdb]] + urls = [ "https://influxdb.gra1.metrics.ovh.net" ] + username = "metrics" + password = "XJ38hW_X9tZXE83rad_wssvkvzXaDC1j2ynLfawIpMANngDGjDWeRqjytKFncgYP.MtlT6t8dDy5K12aGL.OIPCvkjDSje8KOoGVNTqpHnDzDDKZ.K_AV8nEjzivC0ka" + +############################################################################### +# INPUTS # +############################################################################### + +[[inputs.processes]] +[[inputs.cpu]] + percpu = false +[[inputs.disk]] + interval = "3600s" + ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] + fielddrop = ["total","used","inodes_free","inodes_total","inodes_used"] +[[inputs.mem]] + fielddrop=["buffered","cached","slab","available_percent","used_percent","wired","commit_limit","commited_as","dirty","high_free","high_total","huge_page_size","huge_pages_free","huge_pages_total","low_free","low_total","mapped","page_tables","shared","sreclaimable","sunreclaim","swap_total","vmalloc_chunk","vmalloc_total","vmalloc_used","write_back","write_back_tmp"] +[[inputs.system]] + fielddrop=["n_users","uptime_format","uptime","n_cpus"] diff --git a/roles/jitsi-enable-stats/files/general.conf b/roles/jitsi-enable-stats/templates/telegraf-general-nrd.conf.j2 similarity index 95% rename from roles/jitsi-enable-stats/files/general.conf rename to roles/jitsi-enable-stats/templates/telegraf-general-nrd.conf.j2 index 1603544..c784c33 100644 --- a/roles/jitsi-enable-stats/files/general.conf +++ b/roles/jitsi-enable-stats/templates/telegraf-general-nrd.conf.j2 @@ -22,8 +22,8 @@ [[outputs.influxdb]] urls = [ "https://influxdb.nereide.fr" ] - username = "metrics" - password = "XXXX" + username = "telegraf" + password = "8qejQkRyNfc5DFUZaPn5QTh3S" ############################################################################### # INPUTS # diff --git a/roles/jitsi-enable-stats/files/jitsi.conf b/roles/jitsi-enable-stats/templates/telegraf-input-jitsi.conf similarity index 100% rename from roles/jitsi-enable-stats/files/jitsi.conf rename to roles/jitsi-enable-stats/templates/telegraf-input-jitsi.conf