diff --git a/modify-abnormal-stack-when-the-disk-field-is-not-con.patch b/modify-abnormal-stack-when-the-disk-field-is-not-con.patch new file mode 100644 index 0000000000000000000000000000000000000000..5b0084b594536facd0bc8aa999f6f10c9753ea53 --- /dev/null +++ b/modify-abnormal-stack-when-the-disk-field-is-not-con.patch @@ -0,0 +1,28 @@ +From b5794ef43f768d7ea9bbbac450deaabbdcff4997 Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Sat, 12 Oct 2024 17:57:01 +0800 +Subject: [PATCH] modify abnormal stack when the disk field is not configured + +--- + src/python/sentryCollector/collect_config.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/python/sentryCollector/collect_config.py b/src/python/sentryCollector/collect_config.py +index 5aa38ec..7ca9898 100644 +--- a/src/python/sentryCollector/collect_config.py ++++ b/src/python/sentryCollector/collect_config.py +@@ -127,9 +127,9 @@ class CollectConfig: + CONF_IO, CONF_IO_MAX_SAVE, CONF_IO_MAX_SAVE_DEFAULT) + result_io_config[CONF_IO_MAX_SAVE] = CONF_IO_MAX_SAVE_DEFAULT + # disk +- disk = io_map_value.get(CONF_IO_DISK).lower() ++ disk = io_map_value.get(CONF_IO_DISK) + if disk: +- disk_str = disk.replace(" ", "") ++ disk_str = disk.lower().replace(" ", "") + pattern = r'^[a-zA-Z0-9-_,]+$' + if not re.match(pattern, disk_str): + logging.warning("module_name = %s section, field = %s is incorrect, use default %s", +-- +2.33.0 + diff --git a/sysSentry.spec b/sysSentry.spec index 395b29eefecbf1dc72576c0ea1a7000cbfc88766..d2ba6a219471ea84f8a14d547ad8eb630d5ad32a 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 39 +Release: 40 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -54,6 +54,8 @@ Patch41: ai_block_io-support-stage-and-iotype.patch Patch42: ebpf-fix-collect-iodump.patch Patch43: fix-io_dump-for-collect-module.patch Patch44: add-root-cause-analysis.patch +Patch45: update-collect-log.patch +Patch46: modify-abnormal-stack-when-the-disk-field-is-not-con.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -97,6 +99,7 @@ This package provides CPU fault detection Summary: Supports slow I/O detection Requires: sysSentry = %{version}-%{release} Requires: pysentry_notify = %{version}-%{release} +Requires: pysentry_collect = %{version}-%{release} %description -n avg_block_io This package provides Supports slow I/O detection based on EBPF @@ -105,6 +108,8 @@ This package provides Supports slow I/O detection based on EBPF Summary: Supports slow I/O detection Requires: python3-numpy Requires: sysSentry = %{version}-%{release} +Requires: pysentry_notify = %{version}-%{release} +Requires: pysentry_collect = %{version}-%{release} %description -n ai_block_io This package provides Supports slow I/O detection based on AI @@ -123,6 +128,13 @@ Requires: sysSentry = %{version}-%{release} %description -n pysentry_notify This package provides Supports xalarm report for plugins +%package -n pysentry_collect +Summary: Supports collect in python immplementation +Requires: sysSentry = %{version}-%{release} + +%description -n pysentry_collect +This package provides Supports collect for plugins + %prep %autosetup -n %{name}-%{version} -p1 @@ -271,6 +283,10 @@ rm -rf %{buildroot} %attr(0600,root,root) %{_sysconfdir}/sysSentry/collector.conf %attr(0600,root,root) %{_unitdir}/sentryCollector.service +# pysentry_collect +%exclude %{python3_sitelib}/sentryCollector/collect_plugin.py +%exclude %{python3_sitelib}/sentryCollector/__pycache__/collect_plugin* + %files -n libxalarm %attr(0550,root,root) %{_libdir}/libxalarm.so @@ -307,7 +323,18 @@ rm -rf %{buildroot} %attr(0600,root,root) %{_sysconfdir}/sysSentry/plugins/ai_block_io.ini %attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io +%files -n pysentry_collect +%attr(0550,root,root) %{python3_sitelib}/sentryCollector/collect_plugin.py +%attr(0550,root,root) %{python3_sitelib}/sentryCollector/__pycache__/collect_plugin* + %changelog +* Sat Oct 12 2024 zhuofeng - 1.0.2-40 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:add pysentry_collect package and update collect log + modify abnormal stack when the disk field is not configured + * Sat Oct 12 2024 heyouzhi - 1.0.2-39 - Type:requirement - CVE:NA diff --git a/update-collect-log.patch b/update-collect-log.patch new file mode 100644 index 0000000000000000000000000000000000000000..74b5436b5b26a76699f85bec75f894a9869c98b9 --- /dev/null +++ b/update-collect-log.patch @@ -0,0 +1,34 @@ +From 73f5028fcab08613833c9f2b432f660c70ac264e Mon Sep 17 00:00:00 2001 +From: zhuofeng +Date: Sat, 12 Oct 2024 16:06:32 +0800 +Subject: [PATCH] update collect log + +--- + src/python/sentryCollector/collect_io.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/python/sentryCollector/collect_io.py b/src/python/sentryCollector/collect_io.py +index 2b10cde..f699c3c 100644 +--- a/src/python/sentryCollector/collect_io.py ++++ b/src/python/sentryCollector/collect_io.py +@@ -156,7 +156,7 @@ class CollectIo(): + for line in file: + count += line.count('.op=' + Io_Category[category].upper()) + if count > 0: +- logging.info(f"io_dump info : {disk_name}, {stage}, {category}, {count}") ++ logging.info(f"io_dump info : {disk_name}, {stage}, {Io_Category[category]}, {count}") + except FileNotFoundError: + logging.error("The file %s does not exist.", io_dump_file) + return count +@@ -318,7 +318,7 @@ class CollectIo(): + curr_io_length = self.get_ebpf_io_length(curr_latency=curr_latency, prev_latency=prev_latency) + curr_io_dump = self.get_ebpf_io_dump(curr_io_dump_count=curr_io_dump_count, prev_io_dump_count=prev_io_dump_count) + if curr_io_dump > 0: +- logging.info(f"ebpf io_dump info : {disk_name}, {stage}, {category}, {curr_io_dump}") ++ logging.info(f"ebpf io_dump info : {disk_name}, {stage}, {io_type}, {curr_io_dump}") + IO_GLOBAL_DATA[disk_name][stage][io_type].insert(0, [curr_lat, curr_io_dump, curr_io_length, curr_iops]) + logging.debug(f"ebpf collect data : {IO_GLOBAL_DATA}") + elapsed_time = time.time() - start_time +-- +2.33.0 +