Thursday, September 4, 2025
HomeGuest BlogsMonitor Zimbra Server with Grafana, Influxdb and Telegraf

Monitor Zimbra Server with Grafana, Influxdb and Telegraf

How do I monitor Zimbra server with Grafana and InfluxDB?. This monitoring has bee done on an all in one Zimbra server deployment, but the setup is similar for other Zimbra installations. We assume you have already installed Zimbra Server or any other version before proceeding. If not, check Zimbra guides:

“If you are irritated by every rub, how will your mirror be polished?” 
 Rumi

Step 1: Install InfluxDB

Install InfluxDB using our guides below.

Install InfluxDB on Ubuntu and Debian

Install InfluxDB on CentOS 7

Step 2: Configure influxdb

Open influxdb configuration file.

sudo vim /etc/influxdb/influxdb.conf

Set like below:

# Uncomment line 15
 bind-address = "127.0.0.1:8088"
# On line 247 under http, uncomment it if you need http authentication
 [http]
 # Determines whether HTTP endpoint is enabled.
 enabled = true
# On line 256, make sure that:
 bind-address = ":8086"

Enable ports on firewall

# CentOS 7
sudo firewall-cmd --add-port=8086/tcp --permanent
sudo firewall-cmd --reload

# Ubuntu
sudo ufw allow 8086/tcp

Step 3: Install Telegraf

Since the repository has been added already, just install telegraf

# CentOS
sudo yum -y install telegraf

# Ubuntu
sudo apt-get -y install telegraf

Follow this article covering installation of Telegraph on RHEL 8/ Centos 8:

A comprehensive guide on how to install Telegraph on Centos 7 is on our blog. Visit:

Step 4: Configure Telegraf

Use your favorite text editor to modify Telegraf configuration file.

sudo vim /etc/telegraf/telegraf.conf

Set to look like this:

[global_tags]
# Configuration for telegraf agent
 [agent]
     interval = "10s"
     debug = false
     hostname = "server-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 = ["http://influxdb-ip:8086"] # Input valid InfluxDB URL, IP address, and port
     database = "database-name" # Input InfluxDB database name for this host
     timeout = "0s"
     username = "auth-username" # Input InfluxDB http authentication username.
     password = "auth-password" # Input InfluxDB http authentication password.
     retention_policy = ""

Create Zimbra specific telegraf file with inputs for Zimbra Processes, Zimbra Scripts, and Linux System Monitoring:

sudo vim /etc/telegraf.d/zimbra.conf

Paste below contents into the file:

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

[[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]]

[[inputs.exec]]
  commands = ["/opt/zimbra/common/bin/checkzimbraversion.sh"]
  name_override = "zimbra_stats"
  data_format = "value"
  data_type = "string"

# # OpenLDAP cn=Monitor plugin
# # As zimbra user run the next to obatin the password zmlocalconfig -s zimbra_ldap_password ldap_master_url
 [[inputs.openldap]]
   host = "YOURZIMBRASERVERHOSTNAME"
   port = 389
   insecure_skip_verify = true
   bind_dn = "uid=zimbra,cn=admins,cn=zimbra"
   bind_password = "YOURZIMBRALDAPPASSWORD"
   reverse_metric_names = true

 [[inputs.postfix]]
    queue_directory = "/opt/zimbra/data/postfix/spool"
    interval = "1s"

Update the following values correctly:

  • YOURZIMBRASERVERHOSTNAME – With your Zimbra server hostname
  • YOURZIMBRALDAPPASSWORD – With Zimbra LDAP Password

Create the script to check Zimbra version:

$ sudo vim /opt/zimbra/common/bin/checkzimbraversion.sh
#!/bin/bash
if [ -f /etc/redhat-release ]; then
  rpm -q --queryformat "%{version}" zimbra-core | awk -F. '{print $1"."$2"."$3 }' | awk -F_ '{print $1" "$2 }'
fi

if [ -f /etc/lsb-release ]; then
  dpkg -s zimbra-core | awk -F"[ ',]+" '/Version:/{print $2}' | awk -F. '{print $1"."$2"."$3" "$4}'
fi

Make the script executable

sudo chmod a+x /opt/zimbra/common/bin/checkzimbraversion.sh

Once done, restart telegraf service

sudo systemctl restart telegraf

Step 5: Install Grafana Monitoring Tool

Install Grafana server on your server:

The default HTTP port is 3000, and default user and group is admin.

Add the port to firewall..

# CentOS 7
sudo firewall-cmd --add-port=3000/tcp --permanent
sudo firewall-cmd --reload

# Ubuntu
sudo ufw allow 3000/tcp

Once done, head over to http://ip-address:3000

Username: admin
Password: admin

Reset the password after initial login.

Step 6: Import Data Sources

Login to Grafana and Add InfluxDB data source

Add grafana data source

Click on InfluxDB

influx db data source

On the above screen, input any name and on the InfluxDB Details, input the database as specified in telegraf.conf file, and username and password as well from the same file.

influx db data source working

Yous should see a message in green as shown above. After that is done, we can import a dashboard. This dashboard was created by Jorge de la Cruz (jorgedelacruz.es) and all credit goes to him.

Head over to Here to view it. Otherwise, you can just put 2846 as the dashboard id and click on load.

import dashboard

You should see a dashboard as shown below:

zimbra grafana dashboard

Thank you guys for following through. You can check other helpful and resourceful articles and guides with links below:

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11795 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6747 POSTS0 COMMENTS
Ted Musemwa
7023 POSTS0 COMMENTS
Thapelo Manthata
6695 POSTS0 COMMENTS
Umr Jansen
6714 POSTS0 COMMENTS