发布时间: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: .........【阅读全文】
发布时间:2013-11-25 17:05:17
#/usr/bin/env#coding:utf8import os,sysdef getline(filepath,line_num): if line_num < 1: return '' for current_line_num,line in enumerate(open(filepath,'rU')): &nbs.........【阅读全文】