MatthiasSchinzel / sysmon

Graphical system monitor for linux, including information about CPU, GPU, Memory, HDD/SDD and your network connections. Similar to windows task manager.
GNU General Public License v3.0
294 stars 25 forks source link

iwconfig: command not found #4

Closed hamadmarri closed 3 years ago

hamadmarri commented 3 years ago

Hi @MatthiasSchinzel ,

I am having this error on opensuse tumblweed kde5 plasma v5.19.5

python3 sysmon.py 
/bin/sh: iwconfig: command not found
Traceback (most recent call last):
  File "sysmon.py", line 593, in <module>
    main()
  File "sysmon.py", line 587, in main
    main = MainWindow()
  File "sysmon.py", line 101, in __init__
    self.s = sysinfo()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 263, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1].split()[1]
IndexError: list index out of range

On my system I am able to run sudo iwconfig only as root

rany2 commented 3 years ago

Use bash -c 'PATH=$PATH:/sbin python3 ./sysmon.py' instead.

MatthiasSchinzel commented 3 years ago

Please try again with @analotia fix!

hamadmarri commented 3 years ago

I did pull master and see the last commits

commit 05406073aedd11238f372fd6c0d8eebfe09a0829 (HEAD -> master, origin/master, origin/HEAD)
Author: Matthias Schinzel <mschinzel@gmx.de>
Date:   Thu Oct 8 17:32:40 2020 +0200

    Fixing GPU nvidia-smi not installed

commit d35647f6b990af03b2e29c11aee89e5e1d143fe4
Merge: bcf1416 af69b6b
Author: Matthias Schinzel <mschinzel@gmx.de>
Date:   Thu Oct 8 17:26:29 2020 +0200

    Merge pull request #6 from analotia/patch-1

    Always make sure that /sbin is in PATH

but still the problem is there

python3 sysmon.py                                                                                                hamad@suse
/bin/sh: iwconfig: command not found
Traceback (most recent call last):
  File "sysmon.py", line 595, in <module>
    main()
  File "sysmon.py", line 589, in main
    main = MainWindow()
  File "sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 271, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1].split()[1]
IndexError: list index out of range

also this solution doesn't work

bash -c 'PATH=$PATH:/sbin python3 ./sysmon.py'
/bin/sh: iwconfig: command not found
Traceback (most recent call last):
  File "./sysmon.py", line 595, in <module>
    main()
  File "./sysmon.py", line 589, in main
    main = MainWindow()
  File "./sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/home/hamad/Downloads/sysmon/src/gather_data.py", line 271, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1].split()[1]
IndexError: list index out of range
MatthiasSchinzel commented 3 years ago

Hm, so I think in your case we might have to discard the wifi speed information. There is no problem implementing this, but I am not a 100% happy with this solution. I will do some research on this case, maybe I can find another solution for you.

rany2 commented 3 years ago

I believe OpenSUSE requires you to also do sudo zypper install iwconfig.

Edit: actually you should do sudo zypper install wireless-tools.

hamadmarri commented 3 years ago

I believe OpenSUSE requires you to also do sudo zypper install iwconfig.

Edit: actually you should do sudo zypper install wireless-tools.

Hi @analotia It is already installed

sudo zypper in wireless-tools                                                                                    hamad@suse
Loading repository data...
Reading installed packages...
'wireless-tools' is already installed.
No update candidate for 'wireless-tools-30.pre9-39.3.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.
sudo zypper install iwconfig                                                                                     hamad@suse
Loading repository data...
Reading installed packages...
'iwconfig' not found in package names. Trying capabilities.
No provider of 'iwconfig' found.
Resolving package dependencies...

Nothing to do.

I think it is installed with wireless-tools I guess the problem is permission denied issue Maybe if I sudo pip install pyq.... and run sudo python3 ./sysmon.py would fix the issue

hamadmarri commented 3 years ago

Maybe if I sudo pip install pyq.... and run sudo python3 ./sysmon.py would fix the issue

No, it is not working either

I did sudo pip install pyqtgraph pyqt5 and run python with sudo

sudo python3 sysmon.py                                                                                           hamad@suse
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

[1]    27328 IOT instruction  sudo python3 sysmon.py
MatthiasSchinzel commented 3 years ago

I removed iwconfig in case it is not installed, or superuser permission are needed. Please try again.

hamadmarri commented 3 years ago

Now it is working without any problems.

I like the how clean and informative is the sysmod.

Note that the information of wlan is still showing correctly. Please see attached image. Screenshot_20201010_175641

I suggest to add right click on a process (in process tab) and provide some functionalities like kill, set priority, send signal.

Thank you @MatthiasSchinzel

rany2 commented 3 years ago

Could you tell us what went wrong?

On 10/10/20 5:56 PM, Hamad Marri wrote:

Closed #4 https://github.com/MatthiasSchinzel/sysmon/issues/4.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MatthiasSchinzel/sysmon/issues/4#event-3862832784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ6I4DJ6NMH4P3ZDKLK4B3DSKBYYVANCNFSM4SI3S2KA.

hamadmarri commented 3 years ago

I removed iwconfig in case it is not installed, or superuser permission are needed. Please try again.

Hi @analotia ,

The quoted comment solved the issue.

Thank you