From 60e9561ff3c71f1e9f86616acdf9234e310eae47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=92=90?= Date: Thu, 29 Feb 2024 11:13:45 +0800 Subject: [PATCH] Add sar -n DEV commond to get_net_info.py --- category/get_net_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/category/get_net_info.py b/category/get_net_info.py index 0322b3d..60da249 100644 --- a/category/get_net_info.py +++ b/category/get_net_info.py @@ -129,6 +129,16 @@ class NetInfo: res += FileOperation.wrap_output_format(cmd_name, cmd_result, split) return Command.cmd_write_file(res, self.__default_file_name) + + def __get_sar_DEV_task1(self, interval, times): + # print("Sar_dev task 1 started") + # get "sar -n DEV" command info + sar_command ="sar -n DEV {} {}".format(interval, times) + cmd_name = 'sar -n DEV' + sar_result = Command.cmd_run(sar_command) + res_d = FileOperation.wrap_output_format(cmd_name, sar_result, '-') + # print("Sar_dev task 1 completed") + return res_d def get_info(self): ''' -- Gitee