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

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -