From 10b3b14aa82dc22a902f0d0781ebb739e6316e5e Mon Sep 17 00:00:00 2001 From: dongjiao Date: Thu, 22 Aug 2024 12:52:22 +0800 Subject: [PATCH] add setting cpu info in kyreport --- kyreport/ky_report.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kyreport/ky_report.py b/kyreport/ky_report.py index 917ca58..8029e2c 100644 --- a/kyreport/ky_report.py +++ b/kyreport/ky_report.py @@ -51,3 +51,9 @@ class KyReport: info['base_info']['system_version'] = Command.cmd_exec(r'cat /etc/.productinfo | grep release') info['base_info']['kernel_version'] = Command.cmd_exec(r'uname -r') # end base info + + # setting base cpu info + info['base_info']['cpu_model'] = Command.cmd_exec('export LANG="en_US.UTF-8" && lscpu | grep \'Model name:\' | cut -d \':\' -f 2 | sed -e \'s/^[ ]*//g\' | sed -e \'s/[ ]*$//g\'') + info['base_info']['cpu_arch'] = Command.cmd_exec('export LANG="en_US.UTF-8" && lscpu | grep \'Architecture:\' | cut -d \':\' -f 2 | sed -e \'s/^[ ]*//g\' | sed -e \'s/[ ]*$//g\'') + info['base_info']['cpu_cores'] = Command.cmd_exec('export LANG="en_US.UTF-8" && lscpu | grep \'CPU(s)\' | grep -v -E "NUMA|On-line" | cut -d \':\' -f 2 | sed -e \'s/^[ ]*//g\' | sed -e \'s/[ ]*$//g\'') + # end base cpu info -- Gitee