Python script to get server information -
how can create python script server information base on these fields?
hostname, osrelease, if it's virtual or physical server.
output
hostname1, redhat 5.8, vmware
i have this:
import platform print 'uname:', platform.uname() print 'system :', platform.system() print 'node :', platform.node() print 'release :', platform.release()
the first 2 columns of required output quite simple obtain:
import platform print (platform.node(), ' '.join(platform.dist()[:2]))
the information of last column, i.e. if python running under virtual or physical machine, seems tricky. consult following pages hints:
have @ following modules:
Comments
Post a Comment