This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
import os | |
import multiprocessing | |
os_name = platform.system() | |
print ("os_name:"+os_name) | |
os_version = platform.version() | |
print ("os_version:"+os_version) | |
cpu_architecture = platform.architecture()[0] | |
print ("cpu_arch:"+cpu_architecture) | |
cpu_number_of_cores = multiprocessing.cpu_count() | |
print ("num_of_cores:"+str(cpu_number_of_cores)) | |
cpu_name = os.popen('wmic cpu get name').read() | |
print ("cpu_name:"+str(cpu_name)) | |
cpu_load = os.popen('wmic cpu get loadpercentage').read() | |
print ("cpu_load:"+str(cpu_load)) | |
total_memory = os.popen('wmic ComputerSystem get TotalPhysicalMemory').read() | |
free_physical_memory = os.popen('wmic os get freephysicalmemory').read() | |
free_virtual_memory = os.popen('wmic os get freevirtualmemory').read() | |
print ("free phy mem:"+str(free_physical_memory)) | |
print ("free vir mem:"+str(free_virtual_memory)) | |
print ("total mem:"+str(total_memory)) | |
number_of_processes_running = os.popen('wmic process get caption|wc -l').read() | |
print ("num of processes:"+str("number_of_processes_running")) | |
import socket | |
network_address_ipv4 = socket.gethostbyname(socket.getfqdn()) | |
print ("ipv4:"+str(network_address_ipv4)) | |
from uuid import getnode | |
network_address_physical = getnode() | |
print ("phy network add:"+str(network_address_physical)) | |
number_of_bytes = os.popen('netstat -s').read() | |
#parse number of bytes | |
#number_of_bytes_in = number_of_bytes['Received'] | |
#number_of_bytes_out = number_of_bytes['Sent'] | |
#in and number of bytes (per second) out for the same network interface | |
# number of bytes in and number of bytes (per second) out for the same network interface is pending |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment