Unable to read logfile

Discussion in 'Installation/Configuration' started by IntrISP, Jun 14, 2024.

  1. IntrISP

    IntrISP New Member

    After upgrading the operating system from SLES 12 to SLES 15, ISPConfig does not display the log files: "Mail Log", "Mail Warn-Log", "Mail Error-Log", "System-Log", "Freshclam-Log", "fail2ban-Log". The message "Unable to read logfile" appears.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure you have the rsyslog package installed.
     
  3. IntrISP

    IntrISP New Member

    S | Name | Summary | Type
    ---+----------------------------+----------------------------------------------------+-----------
    i | rsyslog | The enhanced syslogd for Linux and Unix | package
    | rsyslog | The enhanced syslogd for Linux and Unix | srcpackage
    i+ | rsyslog-doc | Additional documentation for rsyslog | package
    | rsyslog-module-gssapi | GSS-API support module for rsyslog | package
    | rsyslog-module-gtls | TLS encryption support module for rsyslog | package
    | rsyslog-module-mmnormalize | Contains the mmnormalize support module for syslog | package
    | rsyslog-module-mysql | MySQL support module for rsyslog | package
    | rsyslog-module-pgsql | PostgreSQL support module for rsyslog | package
    | rsyslog-module-relp | RELP protocol support module for syslog | package
    | rsyslog-module-snmp | SNMP support module for rsyslog | package
    | rsyslog-module-udpspoof | UDP spoof support module for syslog | package
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Is this a list of available packages or of installed packages?
     
  5. IntrISP

    IntrISP New Member

    rsyslog is installed.


    Information for package rsyslog:
    --------------------------------
    Repository : SLE-Module-Basesystem15-SP5-Updates
    Name : rsyslog
    Version : 8.2306.0-150400.5.27.1
    Arch : x86_64
    Vendor : SUSE LLC <https://www.suse.com/>
    Support Level : Level 3
    Installed Size : 2.6 MiB
    Installed : Yes (automatically)
    Status : up-to-date
    Source package : rsyslog-8.2306.0-150400.5.27.1.src
    Upstream URL : http://www.rsyslog.com/
    Summary : The enhanced syslogd for Linux and Unix
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, then you should check if the log files get created by your system, and if not, investigate why this is not the case anymore. ISPConfig just reads them, but if the new SLES version stopped creating them, then ISPConfig can not show their content.
     
  7. IntrISP

    IntrISP New Member

    ls -la /var/log/mail*
    -rw-r----- 1 root root 327401947 Jun 14 16:06 /var/log/mail
    -rw-r----- 1 root root 36659476 Jun 14 00:03 /var/log/mail-20240614.xz
    -rw-r----- 1 root root 270207 Jun 14 15:38 /var/log/mail.err
    -rw-r----- 1 root root 78928 Jun 13 22:02 /var/log/mail.err-20240613.xz
    -rw-r----- 1 root root 326676006 Jun 14 16:06 /var/log/mail.info
    -rw-r----- 1 root root 36585732 Jun 14 00:03 /var/log/mail.info-20240614.xz
    -rw-r----- 1 root root 2845797 Jun 14 16:05 /var/log/mail.warn
    -rw-r----- 1 root root 219164 Jun 14 00:03 /var/log/mail.warn-20240614.xz
     
  8. IntrISP

    IntrISP New Member

    In the `dbispconfig` database, the `monitor_data` table contains information about errors:
    dbispconfig_monitor_data.png
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The database contains what you see in the UI. So it contains the info that the log files could not be read. You can e.g. take a look at the code of the cron plugins that read the info. You can find them in /usr/local/ispconfig/server/lib/classes/cron.d/

    It might be that some paths have changed with your OS upgrade. ISPConfig does not contain support for SLES, so it might be that you have to adjust the ISPConfig code to fully work on your system.
     
    michelangelo likes this.
  10. michelangelo

    michelangelo Active Member

    The code in ISPConfig that reads the mail log files expects the following files:


    Code:
                    case 'log_mail':
                            if ($dist == 'debian') {
                                    $logfile = '/var/log/mail.log';
                            } elseif ($dist == 'redhat') {
                                    $logfile = '/var/log/maillog';
                            } elseif ($dist == 'suse') {
                                    $logfile = '/var/log/mail.info';
                            } elseif ($dist == 'gentoo') {
                                    $logfile = '/var/log/maillog';
                            }
                            break;
                    case 'log_mail_warn':
                            if ($dist == 'debian') {
                                    $logfile = '/var/log/mail.warn';
                            } elseif ($dist == 'redhat') {
                                    $logfile = '/var/log/maillog';
                            } elseif ($dist == 'suse') {
                                    $logfile = '/var/log/mail.warn';
                            } elseif ($dist == 'gentoo') {
                                    $logfile = '/var/log/maillog';
                            }
                            break;
                    case 'log_mail_err':
                            if ($dist == 'debian') {
                                    $logfile = '/var/log/mail.err';
                            } elseif ($dist == 'redhat') {
                                    $logfile = '/var/log/maillog';
                            } elseif ($dist == 'suse') {
                                    $logfile = '/var/log/mail.err';
                            } elseif ($dist == 'gentoo') {
                                    $logfile = '/var/log/maillog';
                            }
                            break;
    
    When I compare the returned output of your ls -la /var/log/mail* command with the PHP code that reads the log files, it should actually (or theoretically) work.

    You may want to enable the debug mode in ISPConfig and check /var/log/ispconfig/cron.log and ispconfig.log for errors.
    By executing "php cron_debug.php --cronjob=100-monitor_mail_log.inc.php" from /usr/local/ispconfig/server you may gain even more insights regarding your problem.

    Nethertheless (open)SuSE is not an officially supported OS, so fixing bugs for such OS is often done by its users.
     
  11. IntrISP

    IntrISP New Member

    Thank you for the suggestion, michelangelo. It was enough to solve the problem with displaying logs in ISP.
     

Share This Page