Skip to content

Instantly share code, notes, and snippets.

@sobuildit
Created July 4, 2020 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sobuildit/bb15874f930f6db9eaa496c315bf3120 to your computer and use it in GitHub Desktop.
Save sobuildit/bb15874f930f6db9eaa496c315bf3120 to your computer and use it in GitHub Desktop.
import psutil
from vcgencmd import Vcgencmd
vcgm = Vcgencmd()
# Network stuff from psutil
net_if_addrs = psutil.net_if_addrs()['eth0'][0]
IP = net_if_addrs.address
netmask = net_if_addrs.netmask
# CPU stuff from psutil
clock = psutil.cpu_freq().current
cpu_usage = psutil.cpu_percent()
MemUsage = psutil.virtual_memory().percent
# Temp from vcgencmd
temp = vcgm.measure_temp()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment