BUG: mk_logwatch ab 2.1.0p10 auf Windows komplett funktionsunfähig

@SergejKipnis do you need the files for all cases or just for the problem @andreas-doehler reported?

It would be great, yes. Or @MarcK case even better

I have added missing functional tests for mk_logwatch plugin for Windows. They wIll be fully enabled for 2.1 and 2.2

1 Like

logwatch.cfg

> # Created by Check_MK Agent Bakery.
# This file is managed via WATO, do not edit manually or you
# lose your changes next time when you update the agent.


"d:\x-trade\x-trade-echt\Client\LOGGING\BOError.log" "d:\x-trade\x-trade-test\Client_Mig73\LOGGING\BOError.log" "d:\x-trade\x-trade-test\Client\BOError.log" overflow=C
 W Kein Drucker installiert
 W Fehler in
 W Fehler beim
 W complexType
 W Puffer zu
 W Division durch Null
 W Die notwendige
 W Dieser Feldname
 W Das Handle
 W Der Objektverweis
 W Der an einen
 W Die Datei
 W Der angegebene

"d:\x-trade\x-trade-echt\Client\LOGGING\WALKBACK\Walkback_Header.log" "d:\x-trade\x-trade-test\Client_Mig73\LOGGING\WALKBACK\Walkback_Header.log" "d:\x-trade\x-trade-test\Client\WALKBACK\Walkback_Header.log" overflow=C maxoutputsize=51200 maxcontextlines=10,10
 W Write Lock Error
 W UndefinedObject
 W Deadlocksituation
 W Der Artikel mit Nummer

"d:\x-trade\x-trade-echt\Client\PRINTING\wetter.xml" overflow=C maxfilesize=5120 maxoutputsize=5120
 C .*Error.*
 C .*error.*

"c:\temp\logtest.log" overflow=C
 W .*Warnung.*
 C .*Kritisch.*
 O .*OK.*
1 Like

logtest.log

Warnung
Kritisch
Warnung
Warnung
Warnung
Kritisch
OK
Warnung
Warnung
Kritisch
Kritisch
1 Like

I have found the error, the fix is in process. The problem is not very complicated, rather a simple one.

Thank you, guys, for detailed information.

2 Likes

Ich habe die p13 getestet.
Ich habe den Eindruck das nicht das letzte Event sondern das Vorletzte ausgewertet wird.
Kann das jemand bestätigen?!

1 Like

Bzw. das letzte wird ignoriert.

Das Problem kann ich nicht bestätigen.
Habe den neuen 2.1.0p13-Agent nun auf die ersten betroffenen Server ausgerollt. Bei mir werden alle Log-Einträge ausgewertet.
Habe auch manuell mal einen Textbaustein, der ein Treffer für Critical ist, ans Ende des Logs gesetzt und es wurde in checkmk richtig angezeigt.

Konnte das Problem jetzt doch auf einem anderen System nachstellen. Vielleicht war es auf dem anderen System ein glücklicher Zufall, dass das Problem nicht aufgetreten ist.
Die Log-Einträge in checkmk scheinen immer einen Eintrag nachzuhängen.

LOL
ich habe gerade einen neuen Versuch gemacht der OK war :smile:

Kann bitte mal jemand die CLUSTER Option unter Windows Testen?

CLUSTER MyCluster
 10.20.30.40
 10.20.40.50

Danke

Der Fehler scheint auch auf der Agent-Seite im Logwatch-Plugin zu liegen.
Bei den temporären Dateien im Verzeichnis C:\ProgramData\checkmk\agent\state\logwatch-batches, wo die Logeinträge seit p9 zwischengespeichert werden, tauchen die Logeinträge auch nicht auf bis ein neuer Eintrag (ob es ein Hit auf eine Regel ist oder nicht ist egal) erstellt wird.
Fast so als ob das Logwatch-Plugin die Datei nur bis zur vorletzten Zeile auswertet.

@SergejKipnis seems you have to look again, works “better” but not as aspected…

Hab ich das richtig verstanden:
‘Info from Last line in the log file on Windows may not appear in GUI’?
oder
Last line in the log file on Windows is ignored by logwatch always’?

@SergejKipnis it is a little bit unclear at the moment which case is true.
From @areinwand infos it looks like the agent is not reporting the last event.
Today i have not much time to investigate deeper.

Doesn’t matter, in any case I will carefully check the mk_logwatch tomorrow.

@SergejKipnis the problem seems to be in the Logwatch-Plugin, because the last log-entry cannot be found in Temp-Files in C:\ProgramData\checkmk\agent\state\logwatch-batches\__ffff_[IPAddress] folder. If you add another message to the log (it doesn’t matter if it is configured as a pattern hit or not) and Reschedule check, a file with the log entry appears in the directory and checkmk-GUI.

Any news to this? Will it be fixed in p14?!

Just to be sure.
I see the problem only when last line has no carriage return(end of line).
I do not see the problem when carriage return is presented
Could anybody confirm/check?