安装paramiko模块 /usr/local/python36/bin/pip3 install paramiko 1.获取cpu使用率 #!/usr/bin/python #coding=utf8 #target: get the cpu's used of remote linux system import paramiko def getlinux(ssh): # get the result of executing command stdin, stdout, stderr = s…
2014年第一个脚本,哈哈!!! expect实现远程主机自动执行命令脚本: #!/usr/bin/expect -- if { [llength $argv] < 4 } { puts "Usage: $argv0 ip user passwd port commands timeout" exit 1 } match_max 600000 set ip [lindex $argv 0] set user [lindex $argv 1] set passwd [lindex…