Get Director vhostCount
William Edwards
wedwards at cyberfusion.nl
Sat Jul 24 19:11:26 EEST 2021
Hi,
I would like to monitor each mail server's amount of available vhosts,
so I can take action when a certain threshold is reached (e.g. adding
mail servers). I'm using Dovecot 2.3.4.1 with Director.
My first idea was to use the Doveadm HTTP API, but the 'directorStatus'
command doesn't return the 'vhostCount' attribute (although the
'directorAdd' and 'directorUpdate' commands take it as input).
My second idea was to directly connect to the 'director-admin' socket
and look at the output of 'HOST-LIST'. I can find all the information I
need in doveadm-connection.c, but I'm not getting the impression that
we're meant to interact with the socket directly. I can't find protocol
documentation, and the error message "doveadm not compatible with this
server (mixed old and new binaries?)" when passing faulty input gives me
the impression that the socket is only meant to be used by Dovecot
directly.
My third idea is to parse 'doveadm director status', but in that case
I'd like to know if that output is likely to change in the future. New
major versions aside, of course.
Or, if anyone else has a better idea, which could very well be the case,
I'd love to hear how people monitor this in the real world.
TIA.
--
With kind regards,
William Edwards
More information about the dovecot
mailing list