This here might not only be helpful for getting port scans, but also for cpu cores, memory size and usage etc.: https://github.com/giampaolo/psutil