In Debian 12 wurde rsyslog entfernt und durch journalctl ersetzt. Deshalb fehlen jetzt einige Log-Dateien die vorher unter /var/log erstellt wurden. Wenn man Logwatch verwendet werden diese nicht mehr verarbeitet. Aber keine Angst, mit ein paar Handgriffen kann man das ändern. Man muss dazu unter /etc/logwatch/conf/services/ für die gewünschten Services entsprechende Konfigurations-Dateien erstellen.

Beginnen wir mit der Installation von Logwatch

apt-get install logwatch

Die Logwatch Konfiguration kopieren

sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/

Öffnen Sie mit Ihrem bevorzugten Editor /etc/logwatch/conf/logwatch.conf. Die unkommentierten Zeilen geben die Standardkonfigurationswerte an. Passen wir zunächst einige Grundlagen an:

Output = mail
MailTo = Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein.
MailFrom = Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein.
Detail = Low
Service = All

Dies setzt voraus, dass Sie auf Host1 bereits E-Mail-Dienste eingerichtet haben, die die Zustellung von E-Mails an Ihre  Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein. ermöglichen. Diese E-Mails werden von Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein. gesendet.

Die Detailebene definiert, wie viele Informationen in den Berichten enthalten sind. Mögliche Werte sind: Low (Niedrig), Medium (Mittel) und High (Hoch).

Für die Services die ihm Bericht enthalten sein sollen erstellen wir die Konfigurations-Dateien unter /etc/logwatch/conf/services/

Für Dovecot zum Beispiel dovecot.conf mit dem Inhalt:

Title = "Dovecot"

# Which logfile group...
Logfile =
Logfile = none
*JournalCtl = "--output=cat --unit=dovecot.service"

Für Named named.conf

Title = "named"
# Which logfile group...
Logfile =
Logfile = none
*JournalCtl = "--output=cat --unit=named.service"

Für Postfix postfix.conf

Title = "Postfix"
# Which logfile group...
Logfile =
Logfile = none
*JournalCtl = "--output=cat --unit=postfix.service"

Für SSHD sshd.conf

Title = "sshd"
# Which logfile group...
Logfile =
Logfile = none
*JournalCtl = "--output=cat --unit=ssh.service"

Und so weiter für alle Services die man im Bericht haben will und im Journalctl verfügbar sind.

Jetzt kann man testen ob auch alles klappt.

sudo logwatch --detail Low --range today

Die Ausgabe sollte etwa so aussehen:

 ################### Logwatch 7.7 (07/22/22) #################### 
        Processing Initiated: Fri Apr 26 06:25:03 2024
        Date Range Processed: yesterday
                              ( 2024-Apr-25 )
                              Period is day.
        Detail Level of Output: 5
        Type of Output/Format: mail / text
        Logfiles for Host: server.xn--mllerhelmut-thb.de
 ################################################################## 
 
 --------------------- clam-update Begin ------------------------ 

 The ClamAV update process was started 24 time(s)
 
 Last ClamAV update process started at Thu Apr 25 23:00:40 2024
 
 Last Status:
    daily.cld database is up-to-date (version: 27256, sigs: 2060084, f-level: 90, builder: raynman)
    main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)
    bytecode.cvd database is up-to-date (version: 335, sigs: 86, f-level: 90, builder: raynman)
 
 ---------------------- clam-update End ------------------------- 

 
 --------------------- Dovecot Begin ------------------------ 

 
 [Dovecot IMAP and POP3] Connections:
 ====================================
 POP3 IMAP Total  Host
 ------------------------------------------------------------------------
    0   14    14  p57a5748c.dip0.t-ipconnect.de
 ------------------------------------------------------------------------
    0   14    14  Total
 
 Dovecot IMAP and POP3 Successful Logins: 14
     14 web8
 
 Dovecot disconnects: 18 Total
     14 Logged out
      4 Disconnected: Too many bad commands (no auth attempts in 0 secs)
 
 **Unmatched Entries**
    master: Warning: SIGHUP received - reloading configuration: 1 Time(s)
    pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=aerosoft rhost=2xx.4.1xx.xxx: 3 Time(s)
    pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot   ruser=Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein. rhost=6x.20.xxx.7x: 3 Time(s)
    pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot   ruser=Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein. rhost=4x.24x.1xx.xxx: 3 Time(s)
    pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot   ruser=Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein. rhost=64.18x.xxx.2xx: 1 Time(s)
    pam_unix(dovecot:auth): check pass; user unknown: 10 Time(s)
 
 ---------------------- Dovecot End ------------------------- 

 
 --------------------- dpkg status changes Begin ------------------------ 

 
 Installed:
    blt:amd64 2.5.3+dfsg-4.1
    sox:amd64 14.4.2+git20190427-3.5
    sphinx-rtd-theme-common:all 1.2.0+dfsg-1
 
 Upgraded:
    php8.3-bcmath:amd64 8.3.6-1+0~20240422.30+debian12~1.gbp9a7ce5 => 8.3.6-1+0~20240424.32+debian12~1.gbp9a7ce5
    php8.3-cgi:amd64 8.3.6-1+0~20240422.30+debian12~1.gbp9a7ce5 => 8.3.6-1+0~20240424.32+debian12~1.gbp9a7ce5
    
 ---------------------- dpkg status changes End ------------------------- 

 
 
 --------------------- HTTPD Errors Begin ------------------------ 

 
 Level notice
    notice code: AH00094:      4 Time(s)
    notice code: AH00489:      4 Time(s)
    notice code: AH00493:      4 Time(s) 
 ---------------------- HTTPD Errors End ------------------------- 

 
 --------------------- Mdadm Begin ------------------------ 

 /dev/md/md2 : clean  - /dev/sdb2 /dev/sda2
 /dev/md/md3 : clean  - /dev/sdb3 /dev/sda3
 
 ---------------------- Mdadm End ------------------------- 

 
 --------------------- named Begin ------------------------ 

 
 Queries (cached) that were denied:
    from 2xx.209.xxx.1xx: 1 Time(s)
    from 1xx.1xx.1xx.2xx: 1 Time(s)
 
 **Unmatched Entries**
    managed-keys-zone: Key 20326 for zone . is now trusted (acceptance timer complete): 2 Time(s)
 
 ---------------------- named End ------------------------- 

 
 --------------------- Smartd Begin ------------------------ 

 
 /dev/sda [SAT] :
    Usage: Temperature_Celsius (194) changed to 
      181, 176, 181, 176, 181, 176, 181, 176, 166, 171, 176, 
 
 /dev/sdb [SAT] :
    Usage: Temperature_Celsius (194) changed to 
      176, 166, 162, 166, 171, 176, 
 
 ---------------------- Smartd End ------------------------- 

 
 --------------------- SSHD Begin ------------------------ 

 
 Network Read Write Errors: 10
 
 Negotiation failed:
    no matching host key type found
       7x.3x.2xx.2xx: 1 Time
 
 Disconnecting after too many authentication failures for user:
    root : 2 Times
 
 Illegal users from:
    1xx.1xx.xx8.7x: 10 Times
       admin1: 1 Time
       arkserver: 1 Time
       health: 1 Time
       icon: 1 Time
       polycom: 1 Time
       recepcao: 1 Time
       sdn: 1 Time
       steam: 1 Time
       user5: 1 Time
       yuyin: 1 Time
 
 Users logging in through sshd:
    debian:
       8x.xx.xxx.1xx (p5xx48c.xxxxt.de): 1 Time
    root:
       xx.1xx.1xx.1xx (p5xxx.xxipxxxxect.de): 553 Times
 
 Received disconnect:
    Bye Bye [preauth]
       xxx.1xx.xxx.7x : 27 Time(s)
    disconnected by user [preauth]
       xx.19x.1xx.xxx : 13 Time(s)
 
 **Unmatched Entries**
 error: kex_exchange_identification: client sent invalid protocol identifier "GET / HTTP/1.1" : 1 Time
 fatal: userauth_pubkey: parse publickey packet: incomplete message [preauth] : 1 Time
 pam_env(sshd:session): deprecated reading of user environment enabled : 363 Times
 
 ---------------------- SSHD End ------------------------- 

 
 --------------------- Disk Space Begin ------------------------ 

 Filesystem      Size  Used Avail Use% Mounted on
 /dev/md3        1.8T  900G  838G  52% /
 /dev/md2        988M  111M  810M  13% /boot
 /dev/sdb1       511M  5.9M  505M   2% /boot/efi
 overlay         1.8T  900G  838G  52% /var/lib/docker/overlay2/a670e13ca65f4292a6d81d682a0fb691ef9f0fe8e7b1f8e8adb7400e87a9d914/merged
 overlay         1.8T  900G  838G  52% /var/lib/docker/overlay2/1eb66be19277a926cf2ebd96f9c99e027a25ae4bdf57ba0b7c0e22cd1fa3f3d0/merged
 
 
 ---------------------- Disk Space End ------------------------- 

 
 --------------------- lm_sensors output Begin ------------------------ 

 power_meter-acpi-0
 Adapter: ACPI interface
 power1:           N/A  (interval =   1.00 s)
 
 acpitz-acpi-0
 Adapter: ACPI interface
 temp1:        +27.8 C  (crit = +119.0 C)
 temp2:        +29.8 C  (crit = +119.0 C)
 
 coretemp-isa-0000
 Adapter: ISA adapter
 Package id 0:  +38.0 C  (high = +80.0 C, crit = +100.0 C)
 Core 0:        +31.0 C  (high = +80.0 C, crit = +100.0 C)
 Core 1:        +31.0 C  (high = +80.0 C, crit = +100.0 C)
 Core 2:        +36.0 C  (high = +80.0 C, crit = +100.0 C)
 Core 3:        +36.0 C  (high = +80.0 C, crit = +100.0 C)
 
 pch_skylake-virtual-0
 Adapter: Virtual device
 temp1:        +35.5 C  
 
 
 ---------------------- lm_sensors output End ------------------------- 

 
 ###################### Logwatch End #########################