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

Bug report #26

Closed smahdink closed 3 years ago

smahdink commented 3 years ago

When using two networks one of which is disabled in the settings. This error pops up:

cat: /sys/class/net/enp1s0f0u2/speed: Invalid argument
Traceback (most recent call last):
  File "/usr/bin/sysmon", line 33, in <module>
    sys.exit(load_entry_point('sysmon==1.0.0', 'console_scripts', 'sysmon')())
  File "/usr/lib/python3.8/site-packages/sysmon/sysmon.py", line 604, in main
    main = MainWindow()
  File "/usr/lib/python3.8/site-packages/sysmon/sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/usr/lib/python3.8/site-packages/sysmon/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/usr/lib/python3.8/site-packages/sysmon/gather_data.py", line 267, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1])
IndexError: list index out of range

`

openalmeida commented 3 years ago

got a same issue, it seems cased by my iphone charge wire which act as an usb adapter.

[root@pc ~]# sysmon 
cat: /sys/class/net/enp0s20u9c4i2/speed: Invalid argument
Traceback (most recent call last):
  File "/usr/local/bin/sysmon", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/sysmon/sysmon.py", line 604, in main
    main = MainWindow()
  File "/usr/local/lib/python3.7/site-packages/sysmon/sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/usr/local/lib/python3.7/site-packages/sysmon/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/usr/local/lib/python3.7/site-packages/sysmon/gather_data.py", line 267, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1])
IndexError: list index out of range

may be an allowlist (configure file or command option) as a filter logic will working, here applyed an ugly patch (worked for me):

# https://github.com/MatthiasSchinzel/sysmon/blob/27d5627c/src/sysmon/gather_data.py#L241
--- if 'virtual' not in line:
+++ if 'virtual' not in line and 'usb' not in line:
MatthiasSchinzel commented 3 years ago

When using two networks one of which is disabled in the settings. This error pops up:

Hi :) I am trying to replicate your issue. Could you please tell me the steps you used to disable one of your network adapters?

MatthiasSchinzel commented 3 years ago

got a same issue, it seems cased by my iphone charge wire which act as an usb adapter.

[root@pc ~]# sysmon 
cat: /sys/class/net/enp0s20u9c4i2/speed: Invalid argument
Traceback (most recent call last):
  File "/usr/local/bin/sysmon", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/sysmon/sysmon.py", line 604, in main
    main = MainWindow()
  File "/usr/local/lib/python3.7/site-packages/sysmon/sysmon.py", line 102, in __init__
    self.s = sysinfo()
  File "/usr/local/lib/python3.7/site-packages/sysmon/gather_data.py", line 59, in __init__
    self.get_max_connection_speed()
  File "/usr/local/lib/python3.7/site-packages/sysmon/gather_data.py", line 267, in get_max_connection_speed
    self.max_connection_speed.append(processes[-1])
IndexError: list index out of range

may be an allowlist (configure file or command option) as a filter logic will working, here applyed an ugly patch (worked for me):

# https://github.com/MatthiasSchinzel/sysmon/blob/27d5627c/src/sysmon/gather_data.py#L241
--- if 'virtual' not in line:
+++ if 'virtual' not in line and 'usb' not in line:

Thank you for your help! Let me check if I can get the same issue with my phone.

Some people might find it useful to have information about this network connection too, so maybe in case of usb we can get the maximum bandwidth with another command.

smahdink commented 3 years ago

@MatthiasSchinzel Connected the phone with usb and turned on usb tethering. Went to gnome settings and turned off my ethernet connection by clicking on the switch.

MatthiasSchinzel commented 3 years ago

I was able to replicate your issue and solved it on my system with sysmon 1.0.1

Please try again and feel free to open if you still have problems on your side!