Psutil A module is a library of cross-platform acquisition processes and system applications (CPU, memory, disk, network, sensor). This module is used for system monitoring, restricting the management of process resources and running processes.
Psutil implements many UNIX platform command lines (ps|top|lsof|netstat|ifconfig|who|df|kill|free|nice|ionice|iostat|iotop|uptime|pidof|tty| taskset|pmap|) function similar to the function, easy to use.
http://psutil.readthedocs.io/en/latest/
1. CPU
1 psutil.cpu_times (percpu=false)
Returns the CPU usage time ancestor. If percpu=true, returns the list of usage for each CPU.
1 # Return CPU Utilization 2 psutil.cpu_times_percent (Interval=none, percpu=False)3 psutil.cpu_count (logical=true ) # Returns the system logic CPU4 psutil.cpu_stats () # returns statistics for the CPU 5 psutil.cpu_freq (percpu=false) # Returns the frequency of the CPU
2. Memory
1 psutil.virtual_memory () # returns statistics about system memory usage 2 psutil.swap_memory () # returns system swap memory statistics
3. Disk
1 psutil.disk_partitions (all=false) # returns all mounted disk devices, including devices, mount points drink a list of file system meta-ancestors 2 Psutil.disk_usage (path) # returns disk statistics 3 psutil.disk_io_counters (Perdisk=false, nowrap= True) # returns disk IO statistics
4. Network
1 psutil.net_io_counters (pernic=false) # return to System network IO statistics 2 psutil.net_ Connections (kind='inet') # return system socket connection 3 Psutil.net_if_addrs () # returns the Nic-bound IP, subnet mask, broadcast address 4 psutil.net_if_stats () # returns information about the NIC
5. Sensor
1 psutil.sensors_temperatures (fahrenheit=false) # returns the hardware temperature 2 psutil.sensors _fans () # return hardware fan speed 3 psutil.sensors_battery () # return battery status
6. Other
1 psutil.boot_time () # system boot time 2 psutil.users () # List of users connected to the system
Python Psutil Module