What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use psutil to collect host CPU utilization, memory availability, filesystem capacity, disk activity, and network traffic in Python. CPU utilization is sampled over time; disk and network activity APIs return cumulative counters that must be turned into rates by comparing successive samples. For historical queries and dashboards, you can optionally expose metrics with prometheus-client.
Install psutil and choose the scope of your monitor
Install psutil in the Python environment that will run the monitor:
As an Amazon Associate I earn from qualifying purchases.
python -m pip install psutil
psutil provides both system-wide and process-level APIs. This example gathers host metrics. That distinction matters: a process metric describes the Python process, while a host metric describes the system visible to it. Operating-system support and individual fields vary; psutil documents support for Linux, Windows, macOS, BSD variants, Solaris, and AIX. Check the API reference for the version you install and validate the fields in your deployment environment.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesCollect one host snapshot
Keep collection separate from display or export. A snapshot can include CPU percentage, virtual memory, capacity for a selected filesystem path, disk I/O counters, and network counters by interface:
#1 Best Overall
import psutil
def sample_host(path="/"):
return {
"cpu_percent": psutil.cpu_percent(interval=None),
"memory": psutil.virtual_memory(),
"disk": psutil.disk_usage(path),
"disk_io": psutil.disk_io_counters(),
"network": psutil.net_io_counters(pernic=True),
}
The returned objects contain byte counts and other numeric values. Keep those values unchanged during collection; convert bytes to units such as MiB only when formatting a display or preparing a report.
Sample CPU utilization over an interval
psutil.cpu_percent(interval=None) is nonblocking, but it needs a prior CPU-time sample for comparison. Discard the first result. The psutil FAQ explains that the first call has no earlier sample and returns a meaningless 0.0; prime the sampler before using its readings. Alternatively, passing a positive interval waits while psutil measures, which is simpler but blocks the calling thread for that interval.
import psutil
import time
psutil.cpu_percent(interval=None) # Prime it; discard the result.
time.sleep(1)
cpu_percent = psutil.cpu_percent(interval=None)
print(cpu_percent)
For a monitor that also collects other metrics, use a sampling loop and allow time between nonblocking CPU calls. See the psutil FAQ and API reference for the documented behavior.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchTrack memory pressure with available memory
psutil.virtual_memory() returns a structure with fields including total, available, free, used, and percent. For a cross-platform indication of memory that can be given to processes without swapping, psutil recommends available. The operating system may use reclaimable cache, so free can be much lower; the meaning of used also depends on the platform. The reported percentage is calculated as (total - available) / total * 100. Display available bytes and percentage together when readers need both a relative and absolute view.
Measure filesystem capacity separately from disk activity
Filesystem capacity
psutil.disk_usage(path) reports capacity for the filesystem containing that path. Choose a path that represents the volume you actually want to monitor; using "/" checks the filesystem containing the root directory. On UNIX systems, reserved space can make the reported free-space and percentage values differ from a simple calculation using only total and used.
Disk I/O activity
psutil.disk_io_counters() returns cumulative I/O counters, such as bytes read and written, rather than a current throughput rate. To calculate approximate bytes per second, subtract the earlier read_bytes or write_bytes value from the later one and divide by elapsed seconds. Use perdisk=True when you need attribution by device instead of host-wide counters. The psutil recipes demonstrate counter-delta sampling.
Rank #3
- 2 Years of Cellular Service Included – Necto offers the most affordable cellular-enabled sensor with 2 full years of 4G LTE service included—no hidden fees, contracts, or WiFi required. With a built-in multi-network SIM card, you can remotely monitor conditions 24/7 and receive real-time alerts. After 2 years, you can renew the subscription from the app for only $6.99 a month.
- Instant Alert & 24/7 Monitoring - Keep tabs on your Home, RV, Car, or Pets from anywhere with the 3-in-1 temperature, humidity & power outage monitor. Customize the high and low temp/humidity thresholds and add up to 5 contacts for unlimited text and email alerts. Receive real-time alerts if critical changes in temp/humidity or a power loss occurs.
- Rechargeable Internal Battery - The Necto smart RV and pet monitor has a 3 day long-lasting rechargeable battery. Unlike WiFi sensors, Necto provides continuous monitoring in the event of a power outage, via its built-in battery and cellular technology. Receive instant alerts on your phone when battery power is low or if the device disconnects from the network.
- Intuitive Mobile App & Easy Setup - Our user-friendly mobile app gives you remote access to your sensor from anywhere. Use your smartphone or PC to customize alert thresholds, view past readings, and manage device settings with ease. The sensor takes minutes to install and requires no technical expertise. Simply activate the device through the app and plug it into any standard wall outlet.
- Fast Refresh & Free Data Storage - The industrial built-in temperature and humidity sensor takes readings every 10 seconds to make sure the temp/humidity are within the safe range. Every 10 minutes the most recent reading is updated on the online portal. Readings are stored on our servers for 1 year and can be downloaded anytime on a CSV file.
Turn network counters into traffic rates
psutil.net_io_counters(pernic=True) returns cumulative counters per network interface, including bytes, packets, errors, and drops. To estimate traffic rates, take two samples, subtract the earlier byte count from the later one, and divide by elapsed seconds. The same method works for packets per second. Per-interface readings make it possible to distinguish traffic on different interfaces; aggregate counters are simpler when that attribution is unnecessary.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Interface names vary by machine. Do not hard-code eth0 unless the deployment guarantees that name. Select interfaces by configuration or iterate over the mapping returned by psutil, and handle an interface that disappears between samples rather than reporting a false rate.
Combine the metrics in a sampling loop
The following illustrative loop primes CPU sampling, gathers snapshots, and calculates network rates using elapsed monotonic time. It assumes the configured interface exists in both samples; production code should handle missing interfaces and deployment-specific fields explicitly.
Rank #4
- 【Remote Control Operations Server】Sipeed NanoKVM is an IP-KVM solution based on the LicheeRV Nano RISC-V Linux single-board computer, inheriting the Nano's compact form factor and powerful capabilities. Breaking free from traditional host requirements for network connectivity and system software, NanoKVM functions as an external hardware device directly providing remote control capabilities.
- 【Powerful Interfaces】Sipeed NanoKVM features one HDMI input port that can be recognized by a computer as a display to capture screen content. One USB 2.0 port connects to the computer host, functioning as a HID device (e.g., keyboard, mouse, touchpad). It also utilizes spare TF card storage space, mounting it as a USB flash drive device.
- 【100Mbps Ethernet Support】Sipeed NanoKVM features a 100Mbps Ethernet port for network transmission of video and control signals. The Full version additionally includes an ATX power control interface (USB-C) for remote host power status monitoring and control. The Full version housing also incorporates an OLED display showing the device's IP address and KVM-related status.
- 【Server Management】Sipeed NanoKVM enables real-time monitoring and control of server operations. Supports remote desktop access and host power cycling: NanoKVM overcomes limitations requiring the host to be networked or specific system software, functioning as external hardware to provide direct remote control capabilities.
- 【Supports Remote Installation】Sipeed NanoKVM emulates a USB flash drive device, enabling mounting of installation images for system deployment or access to computer BIOS settings. The NanoKVM Lite features two serial ports for use with IPMI or connection to other development boards via web-based serial terminal interaction. Users may also expand functionality with additional accessories.
import time
import psutil
def sample_host(path="/"):
return {
"cpu_percent": psutil.cpu_percent(interval=None),
"memory": psutil.virtual_memory(),
"disk": psutil.disk_usage(path),
"disk_io": psutil.disk_io_counters(),
"network": psutil.net_io_counters(pernic=True),
}
psutil.cpu_percent(interval=None) # Prime and discard the initial reading.
time.sleep(1)
previous = sample_host()
previous_time = time.monotonic()
interface = "eth0" # Replace with a configured interface for this host.
while True:
time.sleep(1)
current = sample_host()
current_time = time.monotonic()
elapsed = current_time - previous_time
old_net = previous["network"].get(interface)
new_net = current["network"].get(interface)
if old_net is not None and new_net is not None and elapsed > 0:
sent_rate = (new_net.bytes_sent - old_net.bytes_sent) / elapsed
received_rate = (new_net.bytes_recv - old_net.bytes_recv) / elapsed
else:
sent_rate = received_rate = None
old_io = previous["disk_io"]
new_io = current["disk_io"]
if old_io is not None and new_io is not None and elapsed > 0:
read_rate = (new_io.read_bytes - old_io.read_bytes) / elapsed
write_rate = (new_io.write_bytes - old_io.write_bytes) / elapsed
else:
read_rate = write_rate = None
print({
"cpu_percent": current["cpu_percent"],
"memory_percent": current["memory"].percent,
"memory_available_bytes": current["memory"].available,
"filesystem_percent": current["disk"].percent,
"disk_read_bytes_per_second": read_rate,
"disk_write_bytes_per_second": write_rate,
"network_sent_bytes_per_second": sent_rate,
"network_received_bytes_per_second": received_rate,
})
previous, previous_time = current, current_time
Disk and network rates are estimates over the interval between samples. Their underlying counters are cumulative, so displaying an absolute counter as if it were a rate would be misleading. The example uses documented psutil APIs; it is not a benchmark or a claim about measurements on a particular server.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose between local output and Prometheus collection
| Approach | Useful when | What it provides | Key consideration |
|---|---|---|---|
| Local sampling loop | You need an immediate local display, log, or simple alerting input. | Whatever values your monitor collects and renders. | You must implement storage or forwarding yourself if you need historical queries or centralized dashboards. |
| prometheus-client | You want Prometheus to scrape an HTTP endpoint for time-series collection. | An application metrics exposition path; the official tutorial demonstrates an endpoint on port 8000. | Expose the psutil values you need; the default process collector is not a substitute for host-wide metrics. |
The client_python documentation describes installing the client and exposing metrics over HTTP. A Prometheus setup is useful when you need collection beyond a single running loop; the client provides exposition, while Prometheus handles scraping and time-series storage.
Keep process metrics distinct from host metrics
The default Python process collector reports metrics for the Python process, including process CPU, memory, file descriptors, and start time. According to the Prometheus collector documentation, it is available only on Linux and reads from /proc. Use psutil for the host metrics in this guide, and add process-level metrics separately when they answer a different monitoring question.
Quick Recap
Account for platform and deployment differences
- Confirm that the fields your monitor reads are available on the operating system and psutil version you deploy; individual APIs and values can differ across platforms.
- Choose filesystem paths, network interfaces, and disk-device detail deliberately. Containers, permissions, and deployment topology can affect what the monitoring process can see.
- Handle unavailable counters and changing interfaces or devices explicitly. Do not silently substitute zero for a missing measurement.
- Check the documentation for your installed psutil version. The current API reference notes breaking API changes in version 8.0, so examples and field assumptions should be checked against the version in use.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




