summaryrefslogtreecommitdiff
path: root/roles/jitsi-enable-stats
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2020-04-16 17:59:04 +0200
committerSamuel Trégouët <samuel.tregouet@nereide.fr>2020-05-26 11:20:42 +0200
commit031728dd0aff6f21a786f47379e171bbe2e76eca (patch)
treed7cb136733596596d6c3ca20e753c9996a525c9c /roles/jitsi-enable-stats
parentf8e710aedfc39fc43c105a141e08dffdf0ee1526 (diff)
ajout install de telegraph
Diffstat (limited to 'roles/jitsi-enable-stats')
-rw-r--r--roles/jitsi-enable-stats/files/general.conf42
-rw-r--r--roles/jitsi-enable-stats/files/jitsi.conf7
-rw-r--r--roles/jitsi-enable-stats/handlers/main.yml8
-rw-r--r--roles/jitsi-enable-stats/tasks/main.yml23
4 files changed, 79 insertions, 1 deletions
diff --git a/roles/jitsi-enable-stats/files/general.conf b/roles/jitsi-enable-stats/files/general.conf
new file mode 100644
index 0000000..1603544
--- /dev/null
+++ b/roles/jitsi-enable-stats/files/general.conf
@@ -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.nereide.fr" ]
+ username = "metrics"
+ password = "XXXX"
+
+###############################################################################
+# 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/jitsi.conf b/roles/jitsi-enable-stats/files/jitsi.conf
new file mode 100644
index 0000000..c1c484f
--- /dev/null
+++ b/roles/jitsi-enable-stats/files/jitsi.conf
@@ -0,0 +1,7 @@
+[[inputs.http]]
+ name_override = "jitsi_stats"
+ urls = [
+ "http://localhost:8080/colibri/stats"
+ ]
+
+ data_format = "json"
diff --git a/roles/jitsi-enable-stats/handlers/main.yml b/roles/jitsi-enable-stats/handlers/main.yml
new file mode 100644
index 0000000..389c440
--- /dev/null
+++ b/roles/jitsi-enable-stats/handlers/main.yml
@@ -0,0 +1,8 @@
+---
+- name: restart telegraf
+ systemd:
+ name: telegraf
+ state: restarted
+ daemon_reload: true
+ enabled: true
+
diff --git a/roles/jitsi-enable-stats/tasks/main.yml b/roles/jitsi-enable-stats/tasks/main.yml
index ccb75df..5fc1018 100644
--- a/roles/jitsi-enable-stats/tasks/main.yml
+++ b/roles/jitsi-enable-stats/tasks/main.yml
@@ -1,5 +1,5 @@
---
-## activation des stats
+## activation des stats dans jitsi
- name: configuration du videobridge pour activer les stats
lineinfile:
@@ -24,3 +24,24 @@
path: "/etc/jitsi/videobridge/config"
regexp: "^JVB_OPTS="
line: 'JVB_OPTS=" --apis=rest "'
+
+## Instalation de Telegraf
+- name: Ajout de la clé du depot Telegraf
+ apt_key:
+ url: https://repos.influxdata.com/influxdb.key
+
+- name: Ajout du depot jitsi
+ apt_repository:
+ repo: deb https://repos.influxdata.com/debian buster stable
+
+- name: Installation de Telegraf
+ apt:
+ name: telegraf
+ update_cache: true
+
+- name: Application de la conf Jitsi pour Telegraf
+ template:
+ src: ../files/jitsi.conf
+ dest: /etc/telegraf/telegraf.d/
+ notify:
+ - restart telegraf