Monitoring Zimbra Collaboration - InfluxDB, Telegraf and Grafana

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Monitoring Zimbra Collaboration - InfluxDB, Telegraf and Grafana

   KB 23525        Last updated on 2017-12-8  

(0 votes)

On this Wiki, we will see how we can monitor Zimbra by using Grafana, InfluxDB and Telegraf, this dashboard is a very early version, v0.1 even. Your feedback is always welcome.

At the end of this Wiki you can have a Dashboard similar to this one:


Infrastructure Topology

Here is the topology followed in this design, in it we have:

  • The Zimbra Collaboration environment on the left side of the image, with Telegraf's agent that collects information that we pass on to you through scripts
  • The InfluxDB database where all these metrics received from Telegraf are stored
  • The Grafana Dashboard that displays the information stored in InfluxDB


Script to collect information from Zimbra Collaboration

In order to collect information from the Zimbra Collaboration mail queues, as well as to calculate messages sent, etc., I have used the pflogsumm itself, and with it I have modified the output to be in InfluxDB format.

You can download the script from here and locate it in the following route, I have called it zimbra_pflogsumm. pl and make it executable:

chmod +rwxr+xr+x /opt/zimbra/common/bin/

You can prove that it returns content to you, and that the telegraph user can run it by launching:

sudo -u telegraf /opt/zimbra/common/bin/ /var/log/zimbra.log

If everything went well, you can see a result similar to this one, but with your numbers of course:

zimbra-stats received=76
zimbra-stats delivered=327
zimbra-stats forwarded=0
zimbra-stats deferred=1
zimbra-stats bounced=5
zimbra-stats rejected=6
zimbra-stats reject_warnings=0
zimbra-stats held=0
zimbra-stats discarded=0
zimbra-stats bytes_received=11889
zimbra-stats bytes_delivered=32229
zimbra-stats senders=7
zimbra-stats sending_hosts_domains=5
zimbra-stats recipients=73
zimbra-stats recipient_hosts_domains=6

Telegraf configuration in Zimbra Collaboration agents

In the servers of Zimbra Collaboration we will have to install Telegraf, you have all the steps in the following Blog post, once we have Telegraf installed, we will have to configure our additional scripts at the end of the file, this way my part at the end shows the scripts of Zimbra and the others to monitor the state of the server:

# Read metrics about cpu usage
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## Comment this line if you want the raw CPU time metrics
  fielddrop = ["time_*"]

# Read metrics about disk usage by mount point
  ignore_fs = ["tmpfs", "devtmpfs"]

# Read metrics about disk IO by device

# Get kernel statistics from /proc/stat

# Read metrics about memory usage

# Get the number of processes and group them by status

# Read metrics about swap memory usage

# Read metrics about system load & uptime

  exe = "memcached"
  prefix = "memcached"

  exe = "java"
  prefix = "java"

  exe = "mysqld"
  prefix = "mysqld"

  exe = "slapd"
  prefix = "slapd"

  exe = "nginx"
  prefix = "nginx"


  commands = ["/opt/zimbra/common/bin/ -d today /var/log/zimbra.log"]
  name_override = "zimbra_stats"
  data_format = "influx"

  commands = ["sed 's/........................//' /opt/zimbra/jetty/webapps/zimbra/downloads/.git/HEAD"]
  name_override = "zimbra_stats"
  data_format = "value"
  data_type = "string"

Once this is done, we'll be able to reboot the service:

service telegraf restart

Importing Dashboard in Grafana

To make your life simpler, I leave you the. json de Grafana ready to be imported, you can download it from here:

I want to thank Lex Rivera for his work, who is the creator of the rest of the Dashboard for the Linux, CPU, Disk, RAM, etc. metrics.

The steps to import them are as follows, go to our Dashboards, and press Import:


The following screen will appear, and we can either upload the downloaded. json file, or enter the ID of the Zimbra Dashboard: 2846, we will automatically appear the following, select our datasource and give it to Import.


After just a few minutes we can start to see a lively Dashboard as follows:


Related articles

Verified Against: Zimbra Collaboration Suite 8.8, 8.7 Date Created: 09/09/2017
Article ID:,_Telegraf_and_Grafana Date Modified: 2017-12-08

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search