发布时间:2019-08-13 07:40:02编辑:auto阅读(1999)
#!/usr/bin/python
import os
import re
hosts = open('/home/haoren/serverlist.ini')
for line in hosts:
if re.search('=',line):
ip = line.split('=')[1].strip()
hostname = os.popen('ssh %s hostname' % ip).readline().strip()
print "%s:%s" % (hostname,ip)
hosts.close()
上一篇: Python练手,pandas
下一篇: Python练习1
50010
49261
39919
36962
31359
28200
27155
21949
21891
20232
259°
236°
220°
388°
401°
1002°
1875°
1749°
1411°
2838°