CentOS-6 – LogWatch

Home » CentOS » CentOS-6 – LogWatch
CentOS 3 Comments

The Logwatch imapd service script distributed with CentOS-6 does not generate anything when I run logwatch –service all on a cyrus-imapd host. Is this expected behaviour? Is there a separate script for cyrus-imapd or are their configuration options required to get the existing script to work.

I have found an ancient (2004) logwatch service script for cyrus-imapd but I was sort of hoping that there was a more up-to-date and officially supported version available somewhere.

Is there?

3 thoughts on - CentOS-6 – LogWatch

  • 1. Check there is data in the log file(s).

    2. Ensure Logwatch has the correct location and names of your log files.

    Check: /usr/share/logwatch/default.conf/logfiles/ – there should be a
    ‘imapd’ file there. I don’t use imapd and there is no such file on my instances of C6.

    Using my /usr/share/logwatch/default.conf/logfiles/exim.conf as an example (I don’t use any of these entries):-

    User changes should be in: /etc/logwatch/conf/logfiles

    My /etc/logwatch/conf/logfiles/eximlog.conf has:-

    3. The name I use ‘eximlog.conf’ is defined in /etc/logwatch/conf/services/exim.conf

    4. Check for a script in: /usr/share/logwatch/scripts/services/imapd

    5. Put modifications (whole replacement scripts)
    in /etc/logwatch/scripts/services/imapd

    6. You can then test Logwatch by logging-on to the server and typing

    logwatch –print –service imapd –range today

    The range can also be: yesterday or even ‘-21 days’ (with apostrophes)

    The problem with log watch is far too many names identical or almost identical.

    Good Luck.

  • Yes. We have cyrus-imapd logging to /var/log/maillog. This appears to be the default setting as I can find no explicit reference to maillog in either /etc/imapd.conf or /etc/cyrus.conf and none to imapd in /etc/rsyslog.conf.

    I do not have one either.

    yum provides /usr/share/logwatch/default.conf/logfiles/imapd.conf Loaded plugins: etckeeper, fastestmirror, priorities, refresh-packagekit Loading mirror speeds from cached hostfile
    * base: CentOS.mirror.rafal.ca
    * epel: mirror.steadfast.net
    * extras: less.cogeco.net
    * updates: mirror.netflash.net No Matches found

    The Logwatch related files that reference imapd are these:

    find /usr/share/logwatch -type f | xargs grep -l imapd
    /usr/share/logwatch/default.conf/services/imapd.conf
    /usr/share/logwatch/default.conf/services/secure.conf
    /usr/share/logwatch/scripts/services/secure
    /usr/share/logwatch/scripts/services/cron
    /usr/share/logwatch/scripts/services/courier
    /usr/share/logwatch/scripts/services/imapd

    Maillog is referenced in
    /usr/share/logwatch/default.conf/services/imapd.conf:

    cat /usr/share/logwatch/default.conf/services/imapd.conf
    ###########################################################################
    #
    ———————————————————————-

  • Tampering with an existing Logwatch script may seem daunting but, as I
    have no Perl skills, it was relative easy to produced a more useful display. Note the amended script should be placed in /etc/logwatch/scripts/services/your-choice-of-file-name

    (1) If your cyrus-imap is similar to the Exim script, there are 2 main parts:-

    (a) identifying the information and accumulating it; and

    (b) printing the data.

    (2) In the standard Exim script I located lines like:-

    {$RecipVerify{$ThisLine}++;}

    {$SendVerify{$ThisLine}++;}

    and inserted my own tests like these (I was testing on error messages I
    created which were prefixed with a self-chosen code)

    ——————