merge master
Signed-off-by: luckky <guodashun1@huawei.com>
This commit is contained in:
commit
6a84f3c770
107
README.md
107
README.md
@ -4,20 +4,103 @@
|
|||||||
sysSentry is a system inspection framework used to manage system inspection tasks.
|
sysSentry is a system inspection framework used to manage system inspection tasks.
|
||||||
|
|
||||||
#### 软件架构
|
#### 软件架构
|
||||||
软件架构说明
|
1. 框架:支持x86和aarch64架构
|
||||||
|
2. 插件:不同的差距支持架构不同,请参考docs.openeuler.org中的内容
|
||||||
|
|
||||||
|
|
||||||
#### 安装教程
|
#### 安装教程
|
||||||
|
|
||||||
1. xxxx
|
1. 安装巡检框架
|
||||||
2. xxxx
|
```shell
|
||||||
3. xxxx
|
[root@openEuler ~]# yum install -y sysSentry
|
||||||
|
```
|
||||||
|
2. 启动巡检框架
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# systemctl start sentryCollector
|
||||||
|
[root@openEuler ~]# systemctl start xalarmd
|
||||||
|
[root@openEuler ~]# systemctl start sysSentry
|
||||||
|
```
|
||||||
|
3. 安装&重载巡检插件
|
||||||
|
step1. 安装用户需要的巡检插件
|
||||||
|
```shell
|
||||||
|
yum install <插件名>
|
||||||
|
```
|
||||||
|
当前支持插件有:
|
||||||
|
- cpu_sentry -- cpu巡检,支持22.03-LTS-SP4版本,aarch64架构,920F芯片使用
|
||||||
|
- avg_block_io -- 平均阈值慢io检测,支持20.03-LTS-SP4版本,x86及aarch64架构
|
||||||
|
- ai_block_io -- AI阈值慢io检测,支持20.03-LTS-SP4版本,x86及aarch64架构
|
||||||
|
|
||||||
|
step2. 重载巡检插件
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl reload <插件名>
|
||||||
|
```
|
||||||
|
|
||||||
#### 使用说明
|
#### 使用说明
|
||||||
|
|
||||||
1. xxxx
|
sysSentry提供了用于管理巡检插件的命令 -- sentryctl,可以用于启动/停止巡检插件任务、查看巡检插件运行状态、查看巡检插件上报信息等功能。
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
1. 启动指定巡检任务
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl start <module_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 终止指定巡检任务
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl stop <module_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 列出所有已加载的巡检任务及状态
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl list
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 查询指定巡检任务的状态
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl status <module_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
巡检任务共存在四种状态,每种状态的回显信息及对应介绍如下:
|
||||||
|
|
||||||
|
| 状态 | 描述 |
|
||||||
|
| ------- | ------------------------------------------------------------ |
|
||||||
|
| RUNNING | 巡检任务正在运行 |
|
||||||
|
| WAITING | 仅period类型巡检任务可设置此状态,表示period巡检任务等待下一次被调度执行 |
|
||||||
|
| EXITED | 巡检任务尚未执行,或者oneshot类型的巡检任务执行结束处于此状态 |
|
||||||
|
| FAILED | 巡检任务未拉起成功,或者巡检任务未正常退出 |
|
||||||
|
|
||||||
|
5. 重载指定巡检任务的配置
|
||||||
|
|
||||||
|
当用户修改了巡检任务的配置文件/etc/sysSentry/tasks/<module_name>.mod时,可通过以下命令重载配置文件:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl reload <module_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
6. 查询指定任务的告警信息
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[root@openEuler ~]# sentryctl get_alarm <module_name> [options]
|
||||||
|
```
|
||||||
|
|
||||||
|
options可选参数及释义如下:
|
||||||
|
|
||||||
|
| 参数 | 描述 |
|
||||||
|
| -------------------------------------- | ------------------------------------------------------------ |
|
||||||
|
| -s TIME_RANGE, --time_range TIME_RANGE | 展示用户指定时间长度内的告警信息,TIME_RANGE为整形,单位秒,范围为1~15 |
|
||||||
|
| -d, --detailed | 打印详细告警信息 |
|
||||||
|
|
||||||
|
7. 查询指定巡检任务的巡检结果
|
||||||
|
|
||||||
|
```shell
|
||||||
|
sentryctl get_result <module_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 参与贡献
|
#### 参与贡献
|
||||||
|
|
||||||
@ -25,13 +108,3 @@ sysSentry is a system inspection framework used to manage system inspection task
|
|||||||
2. 新建 Feat_xxx 分支
|
2. 新建 Feat_xxx 分支
|
||||||
3. 提交代码
|
3. 提交代码
|
||||||
4. 新建 Pull Request
|
4. 新建 Pull Request
|
||||||
|
|
||||||
|
|
||||||
#### 特技
|
|
||||||
|
|
||||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
||||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
||||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
||||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
||||||
|
|||||||
48
fix-alarm_info-newline-break-error.patch
Normal file
48
fix-alarm_info-newline-break-error.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From fe1bb401c1f77860616e74c1dbf5fe6aa862b17d Mon Sep 17 00:00:00 2001
|
||||||
|
From: jinsaihang <jinsaihang@h-partners.com>
|
||||||
|
Date: Sat, 26 Oct 2024 07:18:16 +0000
|
||||||
|
Subject: [PATCH] fix alarm_info newline break error
|
||||||
|
|
||||||
|
Signed-off-by: jinsaihang <jinsaihang@h-partners.com>
|
||||||
|
---
|
||||||
|
sysSentry-1.0.2/src/python/syssentry/alarm.py | 23 +++++++++++++++++++
|
||||||
|
1 file changed, 23 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/python/syssentry/alarm.py b/src/python/syssentry/alarm.py
|
||||||
|
index 2575307..b35a126 100644
|
||||||
|
--- a/src/python/syssentry/alarm.py
|
||||||
|
+++ b/src/python/syssentry/alarm.py
|
||||||
|
@@ -180,7 +180,30 @@ def get_alarm_result(task_name: str, time_range: int, detailed: bool) -> List[Di
|
||||||
|
if 'details' in alarm_info:
|
||||||
|
alarm_info.pop('details', None)
|
||||||
|
alarm.pop('msg1', None)
|
||||||
|
+
|
||||||
|
+ # dump each {key,value} of details in one line
|
||||||
|
+ if 'details' in alarm_info and isinstance(alarm_info['details'], dict):
|
||||||
|
+ for key in alarm_info['details']:
|
||||||
|
+ alarm_info['details'][key] = json.dumps(alarm_info['details'][key], indent=None)
|
||||||
|
+
|
||||||
|
alarm['alarm_info'] = alarm_info
|
||||||
|
+ alarm_list = [alarm for alarm in alarm_list if 'alarm_source' in alarm['alarm_info'] and alarm['alarm_info']['alarm_source'] == task_name]
|
||||||
|
+
|
||||||
|
+ alarm_level_mapping = {
|
||||||
|
+ 1: 'MINOR_ALM',
|
||||||
|
+ 2: 'MAJOR_ALM',
|
||||||
|
+ 3: 'CRITICAL_ALM'
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ alarm_type_mapping = {
|
||||||
|
+ 1: 'ALARM_TYPE_OCCUR',
|
||||||
|
+ 2: 'ALARM_TYPE_RECOVER'
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ for alarm in alarm_list:
|
||||||
|
+ alarm['alarm_level'] = alarm_level_mapping.get(alarm['alarm_level'], 'UNKNOWN_LEVEL')
|
||||||
|
+ alarm['alarm_type'] = alarm_type_mapping.get(alarm['alarm_type'], 'UNKNOWN_TYPE')
|
||||||
|
return alarm_list
|
||||||
|
+
|
||||||
|
finally:
|
||||||
|
alarm_list_lock.release()
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -4,7 +4,7 @@
|
|||||||
Summary: System Inspection Framework
|
Summary: System Inspection Framework
|
||||||
Name: sysSentry
|
Name: sysSentry
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 51
|
Release: 52
|
||||||
License: Mulan PSL v2
|
License: Mulan PSL v2
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||||
@ -70,7 +70,8 @@ Patch57: update-collect-plugin-period-max.patch
|
|||||||
Patch58: fix-frequency-param-check-bug.patch
|
Patch58: fix-frequency-param-check-bug.patch
|
||||||
Patch59: ai_block_io-support-iodump.patch
|
Patch59: ai_block_io-support-iodump.patch
|
||||||
Patch60: fix-get_alarm-error.patch
|
Patch60: fix-get_alarm-error.patch
|
||||||
Patch61: add-hbm-online-repair.patch
|
Patch61: fix-alarm_info-newline-break-error.patch
|
||||||
|
Patch62: add-hbm-online-repair.patch
|
||||||
|
|
||||||
BuildRequires: cmake gcc-c++
|
BuildRequires: cmake gcc-c++
|
||||||
BuildRequires: python3 python3-setuptools
|
BuildRequires: python3 python3-setuptools
|
||||||
@ -364,12 +365,18 @@ rm -rf %{buildroot}
|
|||||||
%attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py
|
%attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sat Oct 26 2024 luckky <guodashun1@huawei.com> - 1.0.2-51
|
* Sat Oct 26 2024 luckky <guodashun1@huawei.com> - 1.0.2-52
|
||||||
- Type:requirement
|
- Type:requirement
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
- SUG:NA
|
- SUG:NA
|
||||||
- DESC:add hbm_online_repair
|
- DESC:add hbm_online_repair
|
||||||
|
|
||||||
|
* Sat Oct 26 2024 jinsaihang <jinsaihang@h-partners.com> - 1.0.2-51
|
||||||
|
- Type:bugfix
|
||||||
|
- CVE:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DES:fix newline break error
|
||||||
|
|
||||||
* Sat Oct 26 2024 zhangnan <zhangnan134@huawei.com> - 1.0.2-50
|
* Sat Oct 26 2024 zhangnan <zhangnan134@huawei.com> - 1.0.2-50
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- CVE:NA
|
- CVE:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user