diff --git a/spug_api/apps/monitor/executors.py b/spug_api/apps/monitor/executors.py index a654613..f759267 100644 --- a/spug_api/apps/monitor/executors.py +++ b/spug_api/apps/monitor/executors.py @@ -57,7 +57,7 @@ def ping_check(addr): def host_executor(host, command): try: with host.get_ssh() as ssh: - exit_code, out = ssh.exec_command(command) + exit_code, out = ssh.exec_command_raw(command) if exit_code == 0: return True, out or '检测状态正常' else: diff --git a/spug_api/apps/schedule/executors.py b/spug_api/apps/schedule/executors.py index 533f0b5..1575a1a 100644 --- a/spug_api/apps/schedule/executors.py +++ b/spug_api/apps/schedule/executors.py @@ -29,7 +29,7 @@ def host_executor(host, command): code, out, now = 1, None, time.time() try: with host.get_ssh() as ssh: - code, out = ssh.exec_command(command) + code, out = ssh.exec_command_raw(command) except AuthenticationException: out = 'ssh authentication fail' except socket.error as e: