This prometheus exporter monitors the exim4 mail transport server. Stats are collected by tailing exim's log files, counting messages queued on disk, and observing running exim processes.
Download and run the latest binary from the releases tab.
./exim_exporter
The exporter will need read access to exim's logs and its spool directory. Therefore, it is recommended to run as the same user as the exim server.
Alternately, a simple Debian package is provided which installs the exporter as a service.
dpkg -i prometheus-exim-exporter*.deb
By default, the exporter serves on port 9636
at /metrics
.
The exporter has two modes:
- The default mode is to process the log files appended to by exim by tailing
them. The default is good for Debian/Ubuntu servers which store the logs in
/var/log/exim4
. Running in this mode on other distributions may require manually configuring the paths. - The second mode utilizes the systemd journal, tailing it for any log lines
sent with the syslog identifier
exim
(configurable). This mode can be enabled using--exim.use-journald
.
In both modes the exporter will additionally poll your spool directory to determine the length of the mail queue.
See --help
for more details. Command line arguments can also be set via
environment variable. e.g --exim.mainlog
-> EXIM_MAINLOG
.
make
See example metrics in tests.
This stat is calculated by tailing the exim mainlog and returning a counter with labels for each log message flag. An additional label is added for messages marked as completed.
Prom Label | Exim Flag |
---|---|
arrived | <= |
fakereject | (= |
delivered | => |
additional | -> |
cutthrough | >> |
suppressed | *> |
failed | ** |
deferred | == |
completed | Completed |
These stats are calculated by tailing the rejectlog and paniclog, returning counter for the number of lines in each.
This metric returns the number of running exim process, labeled by process state.
The state is detected by parsing the process's command line and looking for known arguments.
While this method doesn't provide the same detail as exiwhat
, that tool is
contraindicated for use in monitoring.
Prom Label | Exim State |
---|---|
daemon | parent pid |
delivering | exim -Mc |
handling | exim -bd |
running | exim -qG |
other | other |
This metric reports the equivalent of exim -bpc
. Note, the value is calculated by independently parsing the queue, not forking to exim.
Whether the main exim daemon is running.
This metrics reports any failures encountered while tailing the logs.
Docker images are available on docker hub.
To enable full functionality the exporter needs access to exim's log files, spool directory, and process list.
For example, if you were running your MTA in a container named exim4
, usage might look something like:
docker run
-p 9636:9636 \
-v /var/log/exim4:/var/log/exim4 \
-v /var/spool/exim4:/var/spool/exim4 \
--pid container:exim4 \
--name exim_exporter \
gvengel/exim_exporter
Also see the provided docker-compose example.