From 92c8a3d2ab8cf9191ff677f9f6d1c9fb4b42912e Mon Sep 17 00:00:00 2001 From: halliday Date: Tue, 19 Mar 2024 20:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E5=B1=95=E7=A4=BA=E6=97=A5=E5=BF=97=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/get_system_info.py | 3 ++- etc/check_config.yml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/get_system_info.py b/bin/get_system_info.py index 86bf9e8..2c361b0 100644 --- a/bin/get_system_info.py +++ b/bin/get_system_info.py @@ -135,7 +135,8 @@ def get_dir_size(path): list1.append(file_size) str_tex = f"\t{item}的大小是{file_size}字节" print(str_tex) - save_txt([str_tex]) + if config["show_file_size"]: + save_txt([str_tex]) elif item.is_dir(): # print(f"目录: {item}") save_txt(['\t--------------']) diff --git a/etc/check_config.yml b/etc/check_config.yml index 8c5892a..fcd4a50 100644 --- a/etc/check_config.yml +++ b/etc/check_config.yml @@ -1,11 +1,13 @@ #邮箱收件人,支持多个 receivers: - - "mh@unamail.com" + - "mh@una-mail.com" # - "ypy@unamail.com" #agent安装路径,windows路径要用双斜线,Linux不需要 agent_dir : "D:\\agent\\ubackup\\uagent\\logs" +#是否展示日志文件大小,默认展示 +show_file_size: true #资源阈值,超过这个值的会发告警 #CPU使用率最大值