Skip to content
BleemeoBleemeo

Exim4

Auto-Detection
Health Check
Built-in Metrics

Bleemeo monitors the Exim4 mail transfer agent through automatic service detection, SMTP service checks, and mail queue metrics.

Glouton automatically detects Exim instances listening on port 25.

To enable metrics gathering, ensure Glouton can run the mailq command. This usually means adding the following to your Exim configuration (e.g. /etc/exim4/conf.d/main/99_local):

queue_list_requires_admin=false

Then refresh the configuration:

Terminal window
update-exim4.conf.template --run
update-exim4.conf

If the auto-detected parameters are incorrect, you can override them manually.

Terminal window
sudo tee /etc/glouton/conf.d/99-exim4.conf > /dev/null << 'EOF'
service:
# For an Exim running outside a container
- type: "exim"
address: "127.0.0.1"
port: 25
# For an additional Exim running outside a container
- type: "exim"
instance: "NAME_ASSOCIATED_WITH_YOUR_ADDITIONAL_SERVICE"
address: "127.0.0.1"
port: 26
# For an Exim running in a Docker container
- type: "exim"
instance: "CONTAINER_NAME"
address: "172.17.0.2"
port: 25
EOF

Glouton performs an SMTP service check when the service listens on port 25.

MetricDescription
service_statusStatus of Exim
MetricDescription
exim_queue_sizeNumber of mails queued

See Troubleshoot a Service Check or Missing Metrics for what applies to every service: finding the address and port Glouton really uses, what each check message means, and how to read the collection error — which does not appear in the agent logs at the default level.

The check is a real SMTP exchange, not a bare connection:

Status text Cause Fix
Unable to connect to SMTP server: connection refused Exim listens on another port, or on another address Set address and port, or widen local_interfaces
SMTP error: ... Exim answered, but rejected the exchange — typically an ACL refusing the agent address Allow the agent address in the connect ACL
Connection timed out after 10 seconds A firewall drops the packets Open the port for the agent

Glouton runs exim4 -bpc once a minute and reads the count it prints. For a containerized Exim it runs the command inside that container; otherwise it runs it on the host — including when the agent itself is containerized, since it enters the host filesystem to do so.

Run the same command the agent runs, as the same user:

Terminal window
sudo -u glouton exim4 -bpc

It must print a single number. The error Glouton gets is logged at the VERBOSE level only, as gather exim queue size, so raise logging.level before looking for it in the agent logs.

What you see Cause Fix
permission denied Listing the queue is restricted to admin users — the Debian default Set queue_list_requires_admin=false as shown above, then rebuild the configuration
exim4: command not found The Exim client tools are absent where the command runs Install them there — on the host for a package installation
an unknown hostroot error in the logs The agent runs in a container started without the host filesystem Add -v /:/hostroot:ro to the agent container, as in the Docker installation