Skip to main content

Monitoring Proxmox Mail Gateway

Proxmox Mail Gateway (PMG) is recognised by its pmgproxy unit and monitored through the tools the appliance ships with: pmgversion, pmgsh and the ClamAV database files on disk. The day's mail statistics, the average processing time and the age of the virus signatures arrive on their own, and one alert about stale signatures ships enabled.

How PMG is recognised​

The signed definition matches a host where the systemd unit pmgproxy.service exists. Every 60 seconds the agent dials the web interface on 127.0.0.1:8006, runs pmgversion for the version fact, queries pmgsh get /statistics/mail for the day's totals and reads the modification time of /var/lib/clamav/daily.cld and daily.cvd. The two commands get 20 seconds each, because the statistics query can be slow on a busy node.

The Postfix inside the appliance is an ordinary Postfix and matches the Postfix definition on its own: queue depth and delivery rates come from there.

What is collected​

The day's mail. From PMG's own statistics: messages processed in total, inbound and outbound, spam and viruses caught on the inbound side, bounces, RBL rejects, greylisted messages, and the average time PMG spent on a message. These are the running totals for the current day, refreshed every minute.

ClamAV signatures. The age of the daily signature database, measured from the last write to daily.cld, with daily.cvd tracked separately. A database that stops being written is the sign that freshclam broke while mail keeps flowing.

Web interface. A connection to port 8006 has to be accepted.

Facts shown on the host page: the PMG version.

SignalMetric
Messages today, total / in / outsvc.pmg.day_total, svc.pmg.day_in, svc.pmg.day_out
Spam, viruses, bounces todaysvc.pmg.day_spam_in, svc.pmg.day_virus_in, svc.pmg.day_bounces_in
RBL rejects, greylisted todaysvc.pmg.day_rbl_rejects, svc.pmg.day_greylist
Average processing timesvc.pmg.avg_process_sec
Signature database agesvc.pmg.clamdb.age_sec, svc.pmg.clamdbCvd.age_sec

Names, tags and units are in the metrics reference; the age metrics follow the file probe pattern described under backups.

Logs. The journal entries of pmgproxy, pmgpolicy, pmgtunnel, pmg-smtp-filter and pmgmirror ship at notice level and above. PMG's Postfix logs to /var/log/mail.log, so a PMG-specific variant reads that file and ships only the lines marked fatal, error, warning or panic. See Logs.

Alerts out of the box​

RuleFires whenSeverityShips
ClamAV signatures are staledaily.cld has not been written for 48 hours, held for one hourwarningon

Signature updates are published several times a day, so two days without a single write is not a quiet day at the vendor, it is a broken updater: a firewall change, a mirror that stopped answering, a full disk. The hour-long hold keeps a reboot or a package upgrade from raising it, and the incident closes once the database is under 24 hours old again. Thresholds and hysteresis are in the rules catalog.

Limitations​

  • The stale-signature rule reads daily.cld. An installation whose database exists only as daily.cvd (no incremental update applied yet) reports its age under clamdbCvd but does not drive the rule.
  • The statistics are the current day's totals from PMG's API, not rates. Per-domain statistics, quarantine size and rule hits are not collected.
  • The web interface check dials 127.0.0.1:8006 only; the SMTP ports are covered by the Postfix definition.
  • Cluster state between PMG nodes is not collected.