主控流程,用于判断远程程序执行成功或失败,并发送失败告警
import paramiko
import datetime
import subprocess
import sys
HOST = "XXXXX"
USER = "XXXXXX"
PWD = "XXXXXX"
PORT = 22
REMOTE = True
ENCODING = "utf-8"
# 创建服务器连接
def connect_linux(HOST, PORT, USER, PWD):
# 创建 SSHClient 实例
Client = paramiko