summaryrefslogtreecommitdiff
path: root/ansible-supervision/roles/set-config-telegraf/templates
diff options
context:
space:
mode:
Diffstat (limited to 'ansible-supervision/roles/set-config-telegraf/templates')
-rw-r--r--ansible-supervision/roles/set-config-telegraf/templates/telegraf.conf.j216
-rw-r--r--ansible-supervision/roles/set-config-telegraf/templates/zimbra_general.conf.j243
-rw-r--r--ansible-supervision/roles/set-config-telegraf/templates/zimbra_specific.conf.j247
3 files changed, 106 insertions, 0 deletions
diff --git a/ansible-supervision/roles/set-config-telegraf/templates/telegraf.conf.j2 b/ansible-supervision/roles/set-config-telegraf/templates/telegraf.conf.j2
new file mode 100644
index 0000000..22c3264
--- /dev/null
+++ b/ansible-supervision/roles/set-config-telegraf/templates/telegraf.conf.j2
@@ -0,0 +1,16 @@
+# /!\ NE PAS MODIFIER /!\ DON'T TOUCH THIS FILE /!\
+# Fichier géré par zextras déposé via ansible
+
+# Global Agent Configuration
+[agent]
+ hostname = "{{ ansible_fqdn }}"
+ flush_interval = "15s"
+ interval = "15s"
+ collection_jitter = "1m"
+
+# Output Plugin InfluxDB
+[[outputs.influxdb]]
+ database = "telegraf"
+ urls = [ "https://fluxsup.zextras.fr" ]
+ username = "zextras"
+ password = "syj4HGGLAgON4XfjbP4u" \ No newline at end of file
diff --git a/ansible-supervision/roles/set-config-telegraf/templates/zimbra_general.conf.j2 b/ansible-supervision/roles/set-config-telegraf/templates/zimbra_general.conf.j2
new file mode 100644
index 0000000..224ac52
--- /dev/null
+++ b/ansible-supervision/roles/set-config-telegraf/templates/zimbra_general.conf.j2
@@ -0,0 +1,43 @@
+# Read metrics about cpu usage
+[[inputs.cpu]]
+ percpu = true
+ totalcpu = true
+ fielddrop = ["time_*"]
+
+# Read metrics about disk usage by mount point
+[[inputs.disk]]
+ ignore_fs = ["tmpfs", "devtmpfs", "squashfs"]
+
+[[inputs.diskio]]
+
+[[inputs.kernel]]
+
+[[inputs.mem]]
+
+[[inputs.processes]]
+
+[[inputs.swap]]
+
+[[inputs.system]]
+
+[[inputs.procstat]]
+ exe = "memcached"
+ prefix = "memcached"
+
+[[inputs.procstat]]
+ exe = "java"
+ prefix = "java"
+
+[[inputs.procstat]]
+ exe = "mysqld"
+ prefix = "mysqld"
+
+[[inputs.procstat]]
+ exe = "slapd"
+ prefix = "slapd"
+
+[[inputs.procstat]]
+ exe = "nginx"
+ prefix = "nginx"
+
+[[inputs.net]] \ No newline at end of file
diff --git a/ansible-supervision/roles/set-config-telegraf/templates/zimbra_specific.conf.j2 b/ansible-supervision/roles/set-config-telegraf/templates/zimbra_specific.conf.j2
new file mode 100644
index 0000000..c2fd225
--- /dev/null
+++ b/ansible-supervision/roles/set-config-telegraf/templates/zimbra_specific.conf.j2
@@ -0,0 +1,47 @@
+# OpenLDAP cn=Monitor plugin
+[[inputs.openldap]]
+ host = "{{ ansible_fqdn }}"
+ port = 389
+ insecure_skip_verify = true
+ bind_dn = "uid=zimbra,cn=admins,cn=zimbra"
+ bind_password = "{{ zimbra_ldap_password }}"
+ reverse_metric_names = true
+
+## Postfix plugin
+#[[inputs.postfix]]
+# queue_directory = "/opt/zimbra/data/postfix/spool"
+# interval = "1s"
+
+## Zimbra metric hourly
+#[[inputs.exec]]
+# commands = ["/etc/telegraf/scripts/zimbra_one_per_hour.sh"]
+# data_format = "influx"
+# interval = "1h"
+# timeout = "15s"
+#
+## Zimbra metric daily
+#[[inputs.exec]]
+# commands = ["/etc/telegraf/scripts/zimbra_one_per_day.sh"]
+# data_format = "influx"
+# interval = "24h"
+# timeout = "90s"
+
+[[inputs.exec]]
+ commands = ["/etc/telegraf/scripts/recup_info_zimbra -daily"]
+ interval = "24h"
+ timeout = "30s"
+ data_format = "json_v2"
+ [[inputs.exec.json_v2]]
+ measurement_name = "flux_zimbra"
+ [[inputs.exec.json_v2.object]]
+ path = "flux_zimbra"
+
+[[inputs.exec]]
+ commands = ["/etc/telegraf/scripts/recup_info_zimbra -hourly"]
+ interval = "1h"
+ timeout = "30s"
+ data_format = "json_v2"
+ [[inputs.exec.json_v2]]
+ measurement_name = "flux_zimbra"
+ [[inputs.exec.json_v2.object]]
+ path = "flux_zimbra"