码迷,mamicode.com
首页 >  
搜索关键字:运维脚本    ( 35个结果
python多线程运维脚本
需求,有一个IP列表文件 ip.txt,里面有1000个ip,那么我要用python同时来处理这1000个IP。 先看ip.txt 192.168.1.1 192.168.1.2 192.168.1.3 ...... 192.168.1.1000 多线程并发脚本 #!/usr/bin/python import threading import sys import os ...
分类:编程语言   时间:2015-01-24 15:58:24    阅读次数:144
python第三方库系列之十--commands库
我们这次讲的是利用commands模块执行Linux shell命令,当我们用Python写运维脚本时,经常需要执行linux shell的命令,Python中的commands模块专门用于调用Linux shell命令,并返回状态和结果,下面是commands模块的3个主要函数:1.comman....
分类:编程语言   时间:2014-11-29 06:43:36    阅读次数:189
python第三方库系列之十--commands库
我们这次讲的是利用commands模块执行Linux shell命令,当我们用Python写运维脚本时,经常需要执行linux shell的命令,Python中的commands模块专门用于调用Linux shell命令,并返回状态和结果,下面是commands模块的3个主要函数: 1.commands.getoutput('shell command') 2.commands.getstat...
分类:编程语言   时间:2014-11-29 00:16:40    阅读次数:376
Linux Shell 运维脚本功底积累
1、删除Linux远程用户连接会话[root@tradx24 logs]# w 10:45:28 up 15 days, 16:23, 4 users, load average: 0.00, 0.00, 0.00USER TTY FROM LOGIN...
分类:系统相关   时间:2014-07-25 14:22:31    阅读次数:398
pexpect练习实例--批量执行远程服务器上的指定脚本
经过几天的学习,pexpect模块对于linux下运维脚本编写属实有用,下面写个脚本检验下学习效果。#!/usr/bin/envpython #coding=utf-8 #远程执行服务器上的脚本 importsys,time,os,multiprocessing try: importpexpect exceptImportError: print""" Youmustinstallpexpectmodule "..
分类:其他好文   时间:2014-05-15 12:55:28    阅读次数:260
35条   上一页 1 2 3 4
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!