Skip to content

Commit

Permalink
2.3.0 fix analyze_log offline (#365)
Browse files Browse the repository at this point in the history
* clog update

* build

* update

* update

* update

* update rca clog_disk_full_scene

* del SsherClient SafeStdio super init func

* update lock_conflict_scene

* update clog_disk_full_scene

* fix analyze_log offline

* fix analyze_log offline
  • Loading branch information
wayyoungboy authored Jul 24, 2024
1 parent 06a5743 commit 695d1bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler/analyzer/analyze_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from common.tool import DirectoryUtil
from common.tool import FileUtil
from common.tool import TimeUtils
import common.ssh_client.local_client as ssh_client_local_client


class AnalyzeLogHandler(BaseShellHandler):
Expand Down Expand Up @@ -279,11 +280,13 @@ def __pharse_offline_log_file(self, ssh_client, log_name, local_store_dir):
:param ssh_helper, log_name
:return:
"""

ssh_client = ssh_client_local_client.LocalClient(context=self.context, node={"ssh_type": "local"})
local_store_path = "{0}/{1}".format(local_store_dir, str(log_name).strip(".").replace("/", "_"))
if self.grep_args is not None:
grep_cmd = "grep -e '{grep_args}' {log_name} >> {local_store_path} ".format(grep_args=self.grep_args, log_name=log_name, local_store_path=local_store_path)
self.stdio.verbose("grep files, run cmd = [{0}]".format(grep_cmd))
ssh_client.exec_cmd(ssh_client, grep_cmd)
ssh_client.exec_cmd(grep_cmd)
else:
download_file(ssh_client, log_name, local_store_path, self.stdio)

Expand Down

0 comments on commit 695d1bd

Please sign in to comment.