Zabbix Template and script for monitoring Zimbra statistics (traffic and stats)
Uses two scripts to populate item:
- zimbraTrafficStats.sh - Script using /opt/zimbra/common/bin/pflogsumm.pl
- zimbraGetStats.sh - Script using /opt/zimbra/bin/zmsoap and zabbix_sender
Grabs info from these providers (Zimbra related tools):
- /opt/zimbra/bin/zmsoap -z -t admin GetServerStatsRequest
- /opt/zimbra/common/bin/pflogsumm.pl
- crontab.txt - cron configuration
- userparameter_zimbra.traffic.conf - Zabbix UserParameter
- zimbra_zabbix - sudo file for zabbix user
- Zabbix Server that can process data being sent.
- zabbix_agent(active) + zabbix_sender on the monitored host.
- Import Template Zimbra Statistics.xml on the Zabbix Server.
- Copy all files to the monitored host.
- Copy userparameter file into the includes folder (Default: /etc/zabbix/zabbix_agentd.d/)
- Copy the script files into your Zabbix folder (Default: /etc/zabbix)
- Make sure the scripts are executable.
- Optional: create a scripts directory inside /etc/zabbix/
- Copy the zimbra_zabbix file into /etc/sudoers.d/
- Check permissions, they should be 0440
- Add the line from crontab.txt to the end of the zimbra users crontab.
- Remember to change the hostname.
To deploy via ansible using dj.wasabi's zabbix-agent role (https://galaxy.ansible.com/dj-wasabi/zabbix-agent)
-
Follow documentation for the role
- Add the scripts to files/scripts/
- Add userparameter files to templates/userparameters/
-
Add these tasks to playbook after the role has been run:
- hosts: all tasks: - name: Add sudoers file for the zabbix user copy: src: roles/dj-wasabi.zabbix-agent/files/sudo/zimbra_zabbix dest: /etc/sudoers.d/zimbra_zabbix mode: 0440 validate: 'visudo -cf %s' become: yes - name: Add cron configuration for zimbraGetStats.sh cron: name: "Run ZimbraGetStats.sh every 1 min." user: zimbra job: /etc/zabbix/scripts/zimbra/zimbraGetStats.sh {{ ansible_fqdn }} >/dev/null 2>&1 become: yes