# 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"
