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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -