From f5d5e84cafb58b6a16b427b2e5a4b67c4c407655 Mon Sep 17 00:00:00 2001 From: William Hirigoyen Date: Tue, 9 Jan 2024 17:13:22 +0100 Subject: [PATCH] dovecot: fix plugin dovecot1 --- CHANGELOG.md | 1 + dovecot/defaults/main.yml | 2 ++ dovecot/files/munin_plugin_dovecot1 | 24 +++++++++++-------- ...olinux-dovecot.conf => munin_plugins.conf} | 0 dovecot/tasks/main.yml | 2 +- dovecot/tasks/munin.yml | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) mode change 100644 => 100755 dovecot/files/munin_plugin_dovecot1 rename dovecot/files/{z-evolinux-dovecot.conf => munin_plugins.conf} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e287b71f..c184cf59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ The **patch** part changes is incremented if multiple releases happen the same m * webapps/nextcloud: fix missing gid * nginx: fix mistake between "check_mode: no" and "when: not ansible_check_mode" (fail in check mode) * nginx: add "when: not ansible_check_mode" in various tasks to prevent fail in check mode +* dovecot: fix plugin dovecot1 ### Removed diff --git a/dovecot/defaults/main.yml b/dovecot/defaults/main.yml index 52e06bda..eb4e6aa1 100644 --- a/dovecot/defaults/main.yml +++ b/dovecot/defaults/main.yml @@ -1,4 +1,6 @@ --- +log2mail_alert_email: Null + dovecot_vmail_uid: 5000 dovecot_vmail_gid: 5000 diff --git a/dovecot/files/munin_plugin_dovecot1 b/dovecot/files/munin_plugin_dovecot1 old mode 100644 new mode 100755 index 83f4d897..27139b73 --- a/dovecot/files/munin_plugin_dovecot1 +++ b/dovecot/files/munin_plugin_dovecot1 @@ -53,15 +53,17 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) { exit 0; } -if (-f "$logfile.0") { - $rotlogfile = $logfile . ".0"; -} elsif (-f "$logfile.1") { - $rotlogfile = $logfile . ".1"; -} elsif (-f "$logfile.01") { - $rotlogfile = $logfile . ".01"; -} else { - $rotlogfile = $logfile . ".0"; -} +# Disable rotated log inpection because name is not deterministic across systems +# and data loss is may 5 min +#if (-f "$logfile.0") { +# $rotlogfile = $logfile . ".0"; +#} elsif (-f "$logfile.1") { +# $rotlogfile = $logfile . ".1"; +#} elsif (-f "$logfile.01") { +# $rotlogfile = $logfile . ".01"; +#} else { +# $rotlogfile = $logfile . ".0"; +#} if ( $ARGV[0] and $ARGV[0] eq "config" ) { print "multigraph dovecot_connections\n"; @@ -179,7 +181,9 @@ if (!defined $pos) { if ($startsize < $pos) { # Log rotated - parseDovecotfile ($rotlogfile, $pos, (stat $rotlogfile)[7]); + # Disable rotated log inpection because name is not deterministic across systems + # and data loss is may 5 min + #parseDovecotfile ($rotlogfile, $pos, (stat $rotlogfile)[7]); $pos = 0; } diff --git a/dovecot/files/z-evolinux-dovecot.conf b/dovecot/files/munin_plugins.conf similarity index 100% rename from dovecot/files/z-evolinux-dovecot.conf rename to dovecot/files/munin_plugins.conf diff --git a/dovecot/tasks/main.yml b/dovecot/tasks/main.yml index adb81238..edb39164 100644 --- a/dovecot/tasks/main.yml +++ b/dovecot/tasks/main.yml @@ -60,7 +60,7 @@ tags: - dovecot -- name: deploy evolix config +- name: deploy evolix config for Dovecot ansible.builtin.template: src: z-evolinux-defaults.conf.j2 dest: /etc/dovecot/conf.d/z-evolinux-defaults.conf diff --git a/dovecot/tasks/munin.yml b/dovecot/tasks/munin.yml index 8d0df9db..c86d8c72 100644 --- a/dovecot/tasks/munin.yml +++ b/dovecot/tasks/munin.yml @@ -51,7 +51,7 @@ - name: Copy Munin config ansible.builtin.copy: - src: z-evolinux-dovecot.conf + src: munin_plugins.conf dest: /etc/munin/plugin-conf.d/zzz-dovecot mode: '0644' notify: restart munin-node