From 72743ceab8f539e1f365c4b69f3887d8d17fb624 Mon Sep 17 00:00:00 2001 From: zhuofeng Date: Wed, 9 Oct 2024 16:01:05 +0800 Subject: [PATCH] update log when it is not lock collect --- sysSentry.spec | 9 ++++- update-log-when-it-is-not-lock-collect.patch | 35 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 update-log-when-it-is-not-lock-collect.patch diff --git a/sysSentry.spec b/sysSentry.spec index 4d98b19..2bc8093 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 23 +Release: 24 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -34,6 +34,7 @@ Patch21: add-pyxalarm-and-pySentryNotify-add-multi-users-supp.patch Patch22: add-sentryctl-get_alarm-module_name-s-time_range-d.patch Patch23: fix-python-3.7-not-support-list-bool-type.patch Patch24: avg_block_io-send-alarm-to-xalarmd.patch +Patch25: update-log-when-it-is-not-lock-collect.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -286,6 +287,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io %changelog +* Wed Oct 9 2024 zhuofeng - 1.0.2-24 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:update log when it is not lock collect + * Wed Oct 9 2024 zhuofeng - 1.0.2-23 - Type:bugfix - CVE:NA diff --git a/update-log-when-it-is-not-lock-collect.patch b/update-log-when-it-is-not-lock-collect.patch new file mode 100644 index 0000000..634a2b9 --- /dev/null +++ b/update-log-when-it-is-not-lock-collect.patch @@ -0,0 +1,35 @@ +From ac73565fdb0e4bc544e5308ea0251dd6be410ed9 Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Wed, 9 Oct 2024 16:37:24 +0800 +Subject: [PATCH] update log when it is not lock collect + +--- + src/python/sentryCollector/collect_io.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/python/sentryCollector/collect_io.py b/src/python/sentryCollector/collect_io.py +index e45947a..2e75187 100644 +--- a/src/python/sentryCollector/collect_io.py ++++ b/src/python/sentryCollector/collect_io.py +@@ -179,13 +179,17 @@ class CollectIo(): + blk_io_hierarchy_path = os.path.join(disk_path, 'blk_io_hierarchy') + + if not os.path.exists(blk_io_hierarchy_path): +- logging.error("no blk_io_hierarchy directory found in %s, skipping.", disk_name) ++ logging.warning("no blk_io_hierarchy directory found in %s, skipping.", disk_name) + continue + + for file_name in os.listdir(blk_io_hierarchy_path): + file_path = os.path.join(blk_io_hierarchy_path, file_name) + if file_name == 'stats': + all_disk.append(disk_name) ++ ++ if len(all_disk) == 0: ++ logging.debug("no blk_io_hierarchy disk, it is not lock-free collection") ++ return False + + if self.loop_all: + self.disk_list = all_disk +-- +2.33.0 + -- Gitee