Python收集linux主机信息,需要安装dmidecode命令,yum-yinstalldmidecode#!/usr/bin/envpython
#coding=utf-8
fromsubprocessimportPopen,PIPE
#获取ifconfig命令信息
defgetIfconfig():
p=Popen([‘ifconfig‘],stdout=PIPE)
data=p.stdout.read().decode()
returndata
#获..
分类:
编程语言 时间:
2017-01-06 22:54:20
阅读次数:
294