From 4a0ac7b2dfbfa28b5ea32d97d4b79a0858b5b363 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 7 May 2023 10:45:45 +0200 Subject: [PATCH] Added wrong password metrics for Minetest. --- .../statoolinfos/metrics/minetest/MinetestLogAnalyzer.java | 5 +++++ .../statoolinfos/metrics/minetest/MinetestProber.java | 1 + 2 files changed, 6 insertions(+) diff --git a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java index d5e4f7b..eedd0da 100644 --- a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestLogAnalyzer.java @@ -163,9 +163,14 @@ public class MinetestLogAnalyzer // metrics.metaverse.logs.error // metrics.metaverse.logs.none // metrics.metaverse.logs.unknown + // metrics.metaverse.wrongpassword if (log.getLevel() == MinetestLogLevel.ACTION) { this.counters.inc("metrics.metaverse.logs.action", year, yearMonth, yearWeek, date); + if (log.getMessage().endsWith(" supplied wrong password (auth mechanism: SRP).")) + { + this.counters.inc("metrics.metaverse.wrongpassword", year, yearMonth, yearWeek, date); + } } else if (log.getLevel() == MinetestLogLevel.WARNING) { diff --git a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestProber.java b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestProber.java index c4953a3..5e5f010 100644 --- a/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestProber.java +++ b/src/fr/devinsy/statoolinfos/metrics/minetest/MinetestProber.java @@ -75,6 +75,7 @@ public class MinetestProber // metrics.metaverse.logs.error // metrics.metaverse.logs.none // metrics.metaverse.logs.unknown + // metrics.metaverse.wrongpassword result = MinetestLogAnalyzer.probe(logs); // metrics.service.database.bytes