Questions tagged [psutil]

psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python.

psutil (process and system utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Python. It is useful mainly for system monitoring, profiling and limiting process resources and management of running processes. It implements many functionalities offered by command line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6 to 3.5.

Resources:

481 questions
1
vote
0 answers

Busybox: check whether the PSU cable is connected or not

Is there any command or some way to check from busybox if the network cable is connected or disconnected. So far I have tried python's psutil package but it seems that psutil is not installed on the busybox system: import…
Eduardo G
  • 370
  • 4
  • 17
1
vote
0 answers

How can I check the size of swap space used during the execution of a Python function?

Is there a Python package that can be used to find out if swap space was used during the execution of a function, and if it was used, the peak amount of usage? I know that psutil can be used to check the status quo of swap space as mentioned in this…
SHM
  • 61
  • 1
  • 8
1
vote
1 answer

Killing a chrome process by url name using python

I would like to run a python automation that will kill a particular chrome tab, by its url name. For example: if time is 09:00, and url is "www.youtube.com", kill this process. I didn't manage to do it using psutil, with the following code, since I…
1
vote
1 answer

psutil pip installation issue for unix

How to replicate the problem: get in unix Create a virtual environment: python3 -m venv venv_dummy Get into virtual environment: source venv_dummy/bin/activate pip install psutil : pip install psutil Host Info: unix like kernel (Linux Mariner).…
Dibyendu Dey
  • 349
  • 2
  • 16
1
vote
1 answer

Kivy App label not updating but Psutil module are updating

from kivy.app import App from kivy.uix.label import Label from kivy.uix.widget import Widget import psutil battery = psutil.sensors_battery() percent = str(battery.percent) class Application(App): def build(self): return Label(text =…
VRV
  • 29
  • 6
1
vote
1 answer

why does python import causes an error with PyImport_ImportModule but not with python interpreter

I have a python module mymodule that contains an import psutil statement. I can run it using python interpreter without any errors. However, I fail to load it with PyImport_ImportModule("mymodule") (from python C API), due to an undefined symbol in…
jsofri
  • 227
  • 1
  • 10
1
vote
1 answer

Python code to get list of application of highest consuming CPU usage in Linux

I am working on a python script which will give us a list of top 5 application or process using the highest CPU in linux. I can get the cpu usage percent by using psutil but I have not been able to find the list of application which are using the…
S Andrew
  • 5,592
  • 27
  • 115
  • 237
1
vote
0 answers

Monitoring resource usage on a shared resource HPC using Python

I have been trying to write a script that monitors the usage of resources on jobs that I run on shared resource (i.e, nodes can be shared by many users based on the requested cpus and memory) HPC clusters. The motivation behind doing so is that it…
Mc Missile
  • 715
  • 11
  • 25
1
vote
1 answer

How to find out the psid of a running python script by name?

I am working with discord.py and praw. The script is supposed to terminate another script by the name of 'r5bot.py' (which is running in the background via nohup) whenever the discord bot receives a message '!kill bot' and start it if the message is…
1
vote
0 answers

What does write_time and write_count actually mean in psutil.disk_io_counters?

I'm trying to capture disk I/O metrics on my system. I found that psutil is exactly what I need. However, their documentation is a little vague in what write_time and write_count actually are. Is write_count the number of writes to the disk in the…
1
vote
0 answers

How to listen for processes activity in windows?

I am trying to execute some code the moment a specific process pops up in my os, I tried using the psutil library and it gives me the option to check all my processes, but the problem is that it ins't efficient to keep iterating over all my…
1
vote
1 answer

How i can install psutil on a alpine chroot on arch linux?

Well, i need an alpine chroot for run my Mongo DB Server, but i can't because when i run the /usr/bin/python3 -m pip install -r etc/pip/compile-requirements.txt, it return's to me this error: gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g…
1
vote
1 answer

How to create an application using docker and still run psutil on hosts computer?

Sorry guys, I am still quite new to Python. I am creating an application through Docker that monitors the cpu usage of a certain application running on the computer and it uses psutil. However when I run the application it doesn't work as it uses…
joshus
  • 31
  • 2
1
vote
0 answers

Profile memory usage of Chrome Webdriver using Python and selenium

I want to analyze the usage of RAM when executing this single line of code webdriver.Chrome().get("url") I want to get results of memory usage like what Task Manager on Chrome shows Chrome Memory Usage I tried several methods, but…
Bihui Jin
  • 13
  • 4
1
vote
1 answer

psutil Returning Inaccurate RAM Usage Information

I am building a hardware utilisation display into my Python project using the psutil package. In the Python shell, I am getting the RAM usage as shown below: >>> import psutil >>> psutil.virtual_memory() svmem(total=17179869184,…
SidS
  • 306
  • 4
  • 17