[EXT] Re: Dovecot Stats for Logwatch

Plutocrat plutocrat at gmail.com
Wed May 26 10:49:57 EEST 2021


On 26/05/2021 14.33, Aki Tuomi wrote:
> I am not sure what is not working for you...
> does `doveadm stats dump` work?

a) Before any stats config it works without error, but gives no output.
doveadm stats dump
metric_name	field	count	sum	min	max	avg	median	stddev	%95

b) If I then enable conf.d/95-stats.conf containing
service stats {
    inet_listener http {
      port = 9900
    }
}

metric client_connections {
   filter = event=client_connection_finished
}

metric auth_success {
   filter = (event=auth_request_finished AND success=yes)
}

metric mail_delivery {
   filter = event=mail_delivery_finished
}

... it works but doesn't seem to collect any data, even if left for 24 hours
doveadm stats dump
metric_name	field	count	sum	min	max	avg	median	stddev	%95
client_connections	duration	0	0	0	0	0.00	0	0.00	0
auth_success	duration	0	0	0	0	0.00	0	0.00	0
mail_delivery	duration	0	0	0	0	0.00	0	0.00	0

c) If I then enable the bits of config that I'm informed will populate the data repository:

# In 10-master.conf
mail_plugins = stats

# In 20-imap.conf
protocol imap {
     mail_plugins = $mail_plugins quota imap_quota
}

# In 20-pop.conf
protocol pop3 {
     mail_plugins = $mail_plugins quota
}
... it then complains
doveadm stats dump
Fatal: Plugin 'stats' not found from directory /usr/lib/dovecot/modules

d) I just changed the in in 10-master-conf to reference old-stats instead of stats, based on my new knowledge and it doesn't complain about the missing module any more. But I'm still not collecting data after 30 mins.
doveadm stats dump
metric_name	field	count	sum	min	max	avg	median	stddev	%95
client_connections	duration	0	0	0	0	0.00	0	0.00	0
auth_success	duration	0	0	0	0	0.00	0	0.00	0
mail_delivery	duration	0	0	0	0	0.00	0	0.00	0

I can do wget http://localhost:9900/metrics and I just get a file that says
VERSION	stats-reader-server	2	0

At this point I'm thinking I'll just write a bash script to parse the logs, but thought I'd see it through as it might help other intrepid dovecot users.

P.


More information about the dovecot mailing list