Skip to content

Add template: Mailcow by Zabbix agent 2 (7.0, 7.4) - #761

Open
linuser wants to merge 2 commits into
zabbix:mainfrom
linuser:add-mailcow-template
Open

Add template: Mailcow by Zabbix agent 2 (7.0, 7.4)#761
linuser wants to merge 2 commits into
zabbix:mainfrom
linuser:add-mailcow-template

Conversation

@linuser

@linuser linuser commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds a community template for monitoring Mailcow-dockerized with Zabbix Agent 2.

What it monitors

247 items across Postfix, Postfix logs, Postscreen, Dovecot, Rspamd (+ Bayes training), security (fail2ban, RBL, DNS SPF/DKIM/DMARC, open relay), a DANE/MTA-STS/TLS-RPT/BIMI security-audit score, disk, mailboxes & domains, mailflow (pflogsumm, with anomaly detection via trendavg()), ClamAV, the Mailcow watchdog, Docker container health, TLS/certificates, backups, SOGo/memcached, quarantine, queue age, sync jobs, updates and aliases.

64 triggers + 8 LLD trigger prototypes, 4 low-level discovery rules (domains, mailboxes, sync jobs, Docker containers), 19 template dashboards.

Architecture

A root collector (files/scripts/mailcow-collector.py, run once a minute by a systemd timer) gathers everything into a 0640 JSON file; the Zabbix agent only reads that file via UserParameters — no Docker access, no sudo, UnsafeUserParameters=0. All operational files (collector, check scripts, UserParameters, systemd units, installer) are in files/; setup is documented in 7.0/README.md.

Guideline conformance
Group Templates/Applications; tags class/target (template), component (every item), scope (every trigger).
Item names use Location: Metric; LLD rule keys/names end in discovery; {$MAILCOW.*} macro namespace with standard .WARN/.CRIT/… suffixes; units on quantity items; value maps for discrete states; no {HOST.NAME} / {ITEM.VALUE} in trigger names; no disaster-severity triggers in the resource template.
Imports without errors on a fresh Zabbix 7.0.
MIT licensed.

Upstream project (issues, full docs, release history): https://github.com/linuser/Mailcow-Zabbix-Monitoring

@linuser

linuser commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

The three structural checks pass, but Check import to Zabbix instance fails with an internal error — UnboundLocalError: cannot access local variable 'file_type' where it is not associated with a value. This is a crash in the CI import script itself, not a template import failure: both templates import cleanly on fresh Zabbix 7.0 and 7.4 instances (manually verified before submitting). The crash may be triggered by the files/ helpers (.sh, .py, .service, .timer, and a Grafana .json, per the guidelines) tripping the import step's file-type detection. Could a maintainer take a look or re-run? Happy to adjust if anything on my side needs changing.

The Grafana JSON is not a Zabbix import file, but the CI validation tries to
import every .json under files/ as a template and crashes on it
(UnboundLocalError: file_type). The dashboard stays available in the upstream
project; README now links to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant