From 2557683c6807f61a135bf350b724087dc59b9212 Mon Sep 17 00:00:00 2001 From: Ward Poelmans Date: Tue, 18 Jun 2024 21:39:56 +0200 Subject: [PATCH] fix patterns for pixiu again --- files/pixiu | 4 ++-- tests/data/pixiu | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/files/pixiu b/files/pixiu index f5b5617..8f8d715 100644 --- a/files/pixiu +++ b/files/pixiu @@ -16,9 +16,9 @@ PIXIU_QUOTA_SIZE_TYPE (?:(?%{NUMBER:int})|(?%{PIXIU_BYTE PIXIU_ALARM_COMMON The used (?%{WORD}) \(%{PIXIU_QUOTA_SIZE_TYPE}\) of (?:the )?quota \(type (?%{WORD}) quota(?:, %{PIXIU_ALARM_USER_TYPE})?\) of dtree \(name (?%{NOTSPACE}), ID (?%{NUMBER:int})\) at %{UNIXPATH:path} in namespace \(name (?%{NOTSPACE}), ID (?%{NUMBER:int})\) -PIXIU_USER_INODE_ALARM %{PIXIU_ALARM_PREFIX} %{PIXIU_ALARM_COMMON} reaches (?:or approaches )?to the (:?(?%{WORD}) (?:file|space) quantity quota of|(?:file|space) quantity (?%{WORD}) quota of) \((?%{NUMBER:int})\)\..* +PIXIU_USER_INODE_ALARM %{PIXIU_ALARM_PREFIX} %{PIXIU_ALARM_COMMON} reaches (?:or approaches )?(?:to )?the (:?(?%{WORD}) (?:file|space) quantity quota of|(?:file|space) quantity (?%{WORD}) quota of) \((?%{NUMBER:int})\).* -PIXIU_USER_SPACE_ALARM %{PIXIU_ALARM_PREFIX} %{PIXIU_ALARM_COMMON} reaches (?:or approaches )?to the (:?(?%{WORD}) space(?: quantity)? quota of|space(?: quantity)? (?%{WORD}) quota of) \((?%{PIXIU_BYTES})\)\..* +PIXIU_USER_SPACE_ALARM %{PIXIU_ALARM_PREFIX} %{PIXIU_ALARM_COMMON} reaches (?:or approaches )?(?:to )?the (:?(?%{WORD}) space(?: quantity)? quota of|space(?: quantity)? (?%{WORD}) quota of) \((?%{PIXIU_BYTES})\).* PIXIU_LOGIN_STATUS failed|succeeded PIXIU_LOGIN_ACTION in|out diff --git a/tests/data/pixiu b/tests/data/pixiu index 1e59cb8..81cf367 100644 --- a/tests/data/pixiu +++ b/tests/data/pixiu @@ -246,4 +246,24 @@ data = [ "action": "out", }, }, + { + "raw": "<187>Jun 17 14:08:15 C4STO01-Node1 alarm[4162768]: <186>2024-06-17 14:08:13 DST 172.19.104.10 OceanStor-Distributed-Storage 1214022 0xFEA6A000C Major(1): The used files (19340) of the quota (type user quota, user name, owner name vsc10831) of dtree (name 108, ID 8200) at /108 in namespace (name user, ID 70) reaches the soft file quantity quota of (19047) and the grace period ended (7) days ago. The user or user group will fail to write data.", + "expected": { + "program": "alarm", + "alarm_severity": "Major", + "alarm_object": "OceanStor-Distributed-Storage", + "alarm_id": "0xFEA6A000C", + "used_files": 19340, + "username": "vsc10831", + "quota_type": "user", + "quota_used_type": "files", + "dtree": "108", + "dtree_id": 8200, + "namespace": "user", + "namespace_id": 70, + "quota_limit_type": "soft", + "quota_files_limit": 19047, + "path": "/108", + }, + }, ]