Dovemon

Dovemon is a backend monitoring tool for director hosts. It monitors backend responses and disables/enables backends if they stop responding. (Requires Dovecot v2.2.19 or later. For older versions use poolmon.)

Configuration file: /etc/dovecot/dovemon.config.yml:

loglevel: 4
syslog_facility: 'local5'
director_admin_socket: /var/run/dovecot/director-admin
lockfile: /var/lock/subsys/dovemon
auth: plain
poll_imap: yes
poll_pop3: no
poll_lmtp: no
imap_ssl: no
pop3_ssl: no
lmtp_ssl: no
interval: 10
timeout: 3
retry_count: 3

Test accounts file: /etc/dovecot/dovemon.testaccounts.yml

10.2.2.75:
username: user0001
password: tosivaikeasalasana
10.2.2.76:
username: user0002
password: tosivaikeasalasana

For master user authentication, the auth setting in dovemon.yml should be set to sasl. Test accounts file:

10.2.2.75:
username: user0001
masteruser: masteruser
password: masterpassword

This file allows configuring a separate test account for each backend. The backend must be specified using the same IP address as what doveadm director status shows for it. if connection to backends fail 3 times in a row per protocol (retry_count in config) dovemon goes to rapid poll mode for the backend. In this rapid mode dovecot does quick round of 10 polls with the same protocol (rapid_rounds in config) and if 7 of them still fail, then issue HOST-DOWN in the backend and FLUSH users form the backend to be redistributed to the remainining backends. Also dovemon issues HOST-UP on backend upon first successful poll if backend is already marked down.

For more information on dovemon workflow see dovemon documentation page

Booleans in Dovemon

In dovemon configuration file, following boolean values are accepted:

True, true, yes
False, false, no

Dovemon configuration options

loglevel

  • Default: 4

  • Values: 0, 1, 2, 4

Logging level. Following levels and their corresponding meaning are available:

0: Info
1: Warning
2: Error
4: Debug (any value greater than 2 will be treated as debug as well)

debug

Start dovemon in debug mode. In debug mode dovemon doesn’t fork to background and prints log messages be stdout.

lockfile

  • Default: /var/lock/subsys/dovemon

Location of local dovemon lock file.

director_admin_socket

  • Default: /var/run/dovecot/director-admin

director-admin unix socket used for director admin communication. director-admin unix listener service needs to be configured in dovecot.conf

logger_socket_addr

  • Default: /dev/log

Path to syslog socket.

syslog_facility

  • Default: mail

Syslog facility to use when logging.

auth

  • Default: plain

  • Values: plain, sasl

Authentication method to use when connecting to Dovecot services. sasl is needed for master authentication.

interval

  • Default: 10

Time interval in seconds at which dovemon polls backends.

timeout

  • Default: 3

Timeout value in seconds for each normal poll round. If at any stage in the poll request timed out, the whole round is marked as failed.

retry_count

  • Default: 3

Number of failed rounds needed for a backend to be considered potentially down. After this many failed rounds, dovemon will perform the rapid round on the backend.

rapid_rounds

  • Default: 10

Number of rapid polls performed.

Setting rapid_rounds to 0 disables the rapid round stage and dovemon will issue HOST-DOWN on the backend right after retry_count number of failed polls.

rapid_fails_needed

  • Default: 7

Number of failed rapid polls required in order to mark backend down. If backend still fails the rapid round checks, a HOST-DOWN command will be issued for the backend.

rapidpoll_timeout

  • Default: 2

Timeout value in seconds for the rapid round operations. If at any stage in the rapid round timeout happens, the whole rapid round is deemed failed and backend is marked as down.

poll_imap

Use IMAP connection to poll backend.

imap_ssl

IMAP connection to backend is encrypted. (applicable when poll_imap is enabled)

imap_port

  • Default: 143

Port used for IMAP connection. (applicable when poll_imap is enabled)

imaps_port

  • Default: 993

Port used for encrypted IMAP connection. (applicable when poll_imap is enabled)

poll_imap_list

Perform IMAP list check in polls. If enabled, dovemon performs an IMAP LIST command on the top-level mail folder and checks command success/failure. (applicable when poll_imap is enabled)

poll_imap_select

Perform IMAP select check in polls. If enabled, inbox folder is selected and command success/failure is checked. (applicable when poll_imap is enabled)

poll_imap_append

Perform IMAP append check in polls. If enabled, a test message containing INTERNALDATE representation of timestamp (at time of append) will be appended to inbox. (applicable when poll_imap is enabled)

Warning

Enabling this option without expunging messages can consume all of disk space over time. It is strongly recommended to enable poll_imap_expunge along with this option.

poll_imap_expunge

Perform IMAP expunge check in polls. If enabled, all messages in inbox are flagged \Deleted and expunged. This option implicitly enables poll_imap_select. (applicable when poll_imap is enabled)

poll_pop3

Use POP3 connection to poll backend.

pop3_ssl

POP3 connection to backend is encrypted. (applicable when poll_pop3 is enabled)

pop3_port

  • Default: 110

Port used for POP3 connection. (applicable when poll_pop3 is enabled)

pop3s_port

  • Default: 995

Port used for encrypted POP3 connection. (applicable when poll_pop3 is enabled)

poll_pop3_stat

Perform POP3 stat check in polls. If enabled, a STAT command is performed and command success/failure is checked. (applicable when poll_pop3 is enabled)

poll_pop3_delete

Perform POP3 delete check in polls. If enabled, all messages in STAT command response will be deleted. This option implicitly enables poll_pop3_stat. (applicable when poll_pop3 is enabled)

poll_lmtp

Use LMTP connection to poll backend.

lmtp_ssl

LMTP connection to backend is encrypted. (applicable when poll_lmtp is enabled)

lmtp_port

  • Default: 24

Port used for LMTP connection. (applicable when poll_lmtp is enabled)

poll_lmtp_deliver

Include LMTP deliver check in polls. If enabled, a test message is delivered on LMTP (using a series of LHLO, MAIL, RCPT, DATA commands) and command responses are checked. (applicable when poll_lmtp is enabled)

Warning

Enabling this option without expunging messages can consume all of disk space over time. It is strongly recommended to enable poll_imap_expunge along with this option.

poll_unknown_backends

Poll those hosts not listed in accounts file but are present in list of backends returned by director (i.e. response to HOST-LIST).

New in version v2.2.32.

use_host_flush

Issue a HOST-FLUSH after marking backend down with HOST-DOWN. If set to false, dovemon issues HOST-RESET-USERS for the host.

New in version v2.2.32.1.

use_delayed_down

delayed_down_delay

  • Default: 120

delayed_down_limit

  • Default: 2

This group of settings configure dovemon to delay marking backends as down.

When enabled, if dovemon detects that a backend is down it puts the backend into down-queue instead of marking it down immediately. Then after duration specified by delayed_down_delay (in seconds) it will perform a check: if number of backends queued down and number of backends already down is more than delayed_down_limit then only log backend failure. Otherwise, marks backend down.

New in version v2.3.9.2.

beupdatescript

  • Default: <empty>

Path to an executable backend update script. If set, on either of events a backend is marked down or brought back up again, this script is called with following arguments:

$/path/to/beupdatescript down/up hostname