发布时间:2013-11-26 17:31:06
import os,sys,datetimeimport paramikofrom optparse import OptionParserdef cpFileSingleIp(sfile,dfile,ip): username = "root" password = "123456" port = 22 t=paramiko.Transport((ip,port)) t.connect(username=username,passwor.........【阅读全文】
发布时间:2013-11-26 17:28:59
#!/usr/bin/env pythonimport paramikoimport osimport sys#host = sys.argv[1]#print hostuser='root'password='123456'port=22cmd='df -h'hosts=['192.168.1.234', '192.168.1.101', ]s=paramiko.SSHClient()s.load_system_host_keys()s.set_missing_host_.........【阅读全文】
发布时间:2013-11-26 17:27:23
import osimport sysimport datetimeimport paramikousername='root'password='123456'port=22ip_list=['192.168.1.234', '192.168.1.101' ]local_file='/data/python/zhongwen.py'remote_file='/data/testdir/zhongwen.py'for ip .........【阅读全文】
发布时间:2013-11-26 17:26:37
import reimport sysimport platformnum_threads = 10queue = Queue()def pinger(i,q): while True: ip=q.get() if platform.system() == 'Linux': cmd="ping -c 1 %s"%ip  .........【阅读全文】
发布时间:2013-11-26 12:41:38
#/usr/bin/env#coding:utf8import tarfile,osdef create_tar(destdir,filename): tar =tarfile.open(filename,"w:gz") for root,dir,files in os.walk(destdir): for file in files: .........【阅读全文】