parameters: (self,sship_list,password_list,syscmd_list)
return_statement: return self.can_login_lst,self.not_login_lst
docstring: 尝试ssh 用户秘密登陆，获取机器基本信息
          :param sship_list:
          :param password_list:
          :param syscmd_list:
          :return:
docstring_summary: 尝试ssh 用户秘密登陆，获取机器基本信息
          :param sship_list:
          :param password_list:
          :param syscmd_list:
          :return:
docstring_tokens: 尝试ssh 用户秘密登陆，获取机器基本信息 : param sship_list : : param password_list : : param syscmd_list : : return :
function: def try_pass_login(self,sship_list,password_list,syscmd_list):
          '''
          尝试ssh 用户秘密登陆，获取机器基本信息
          :param sship_list:
          :param password_list:
          :param syscmd_list:
          :return:
          '''
          password_list = password_list
          syscmd_list = syscmd_list
          if isinstance(sship_list, dict):
              ssh_tuple_list = [(ip,port) for ip,port in sship_list.items()]
          elif isinstance(sship_list,list):
              ssh_tuple_list = sship_list
          for ip,port in ssh_tuple_list:
              system_info = ""
              for password in password_list:
                  if ip not in self.can_login_lst.keys():
                      login_info = (ip,int(port),'root', password)   #一定是root 扫描
                      doobj = ssh_do(login_info)  #初始化
                      res = doobj.pass_do(login_info,syscmd_list)#密码登陆尝试，并且执行命令
                      if res["status"] == "success":
                          if self.not_login_lst.has_key(ip):
                              self.not_login_lst.pop(ip)
                          sys_hostname =hostname_type_trans(res["hostname"])
                          sys_mac = mac_trans(res["cat /sys/class/net/[^vtlsb]*/address||esxcfg-vmknic -l|awk '{print $8}'|grep ':'"])
                          sys_sn = sn_trans(res["dmidecode -s system-serial-number"])
                          system_info = getsysversion([res["cat /etc/redhat-release"],res["cat /etc/issue"]])
                          machine_type = machine_type_trans(res["dmidecode -s system-manufacturer"] + res["dmidecode -s system-product-name"])
                          cpu_model= remove_space_line_symbol(res["grep 'model name' /proc/cpuinfo |uniq |awk -F : '{print $2}' |sed 's/^[ \t]*//g'"])
                          cpu_num=remove_space_line_symbol(res["grep 'processor' /proc/cpuinfo |sort |uniq |wc -l"])
                          mem_total=remove_space_line_symbol(res["cat /proc/meminfo |grep 'MemTotal' |awk -F : '{print $2/1048576}' |sed 's/^[ \t]*//g'"])
  
  
                          logging.info("ssh login and exec command:%s",res)
                          self.can_login_lst[ip] = (port,password,'root',system_info,sys_hostname,sys_mac,sys_sn,machine_type,cpu_model,cpu_num,mem_total)
                      elif res["status"] == "failed" and re.search(r"reading SSH protocol banner",res["res"]):
  
                          print ("IP:%s Connection closed by remote host,Sleep 60 (s).................. "%ip,res)
                          time.sleep(20)
                      else:
                          if ip not in self.not_login_lst.keys() and ip not in self.can_login_lst.keys():
                              self.not_login_lst[ip] = port
                          # print ip,port,password,traceback.print_exc()
          return self.can_login_lst,self.not_login_lst
function_tokens: def try_pass_login ( self , sship_list , password_list , syscmd_list ) : password_list = password_list syscmd_list = syscmd_list if isinstance ( sship_list , dict ) : ssh_tuple_list = [ ( ip , port ) for ip , port in sship_list . items ( ) ] elif isinstance ( sship_list , list ) : ssh_tuple_list = sship_list for ip , port in ssh_tuple_list : system_info = "" for password in password_list : if ip not in self . can_login_lst . keys ( ) : login_info = ( ip , int ( port ) , 'root' , password ) #一定是root 扫描 doobj = ssh_do ( login_info ) #初始化 res = doobj . pass_do ( login_info , syscmd_list ) #密码登陆尝试，并且执行命令 if res [ "status" ] == "success" : if self . not_login_lst . has_key ( ip ) : self . not_login_lst . pop ( ip ) sys_hostname = hostname_type_trans ( res [ "hostname" ] ) sys_mac = mac_trans ( res [ "cat /sys/class/net/[^vtlsb]*/address||esxcfg-vmknic -l|awk '{print $8}'|grep ':'" ] ) sys_sn = sn_trans ( res [ "dmidecode -s system-serial-number" ] ) system_info = getsysversion ( [ res [ "cat /etc/redhat-release" ] , res [ "cat /etc/issue" ] ] ) machine_type = machine_type_trans ( res [ "dmidecode -s system-manufacturer" ] + res [ "dmidecode -s system-product-name" ] ) cpu_model = remove_space_line_symbol ( res [ "grep 'model name' /proc/cpuinfo |uniq |awk -F : '{print $2}' |sed 's/^[ \t]*//g'" ] ) cpu_num = remove_space_line_symbol ( res [ "grep 'processor' /proc/cpuinfo |sort |uniq |wc -l" ] ) mem_total = remove_space_line_symbol ( res [ "cat /proc/meminfo |grep 'MemTotal' |awk -F : '{print $2/1048576}' |sed 's/^[ \t]*//g'" ] ) logging . info ( "ssh login and exec command:%s" , res ) self . can_login_lst [ ip ] = ( port , password , 'root' , system_info , sys_hostname , sys_mac , sys_sn , machine_type , cpu_model , cpu_num , mem_total ) elif res [ "status" ] == "failed" and re . search ( r"reading SSH protocol banner" , res [ "res" ] ) : print ( "IP:%s Connection closed by remote host,Sleep 60 (s).................. " % ip , res ) time . sleep ( 20 ) else : if ip not in self . not_login_lst . keys ( ) and ip not in self . can_login_lst . keys ( ) : self . not_login_lst [ ip ] = port # print ip,port,password,traceback.print_exc() return self . can_login_lst , self . not_login_lst