On 9/5/21, Linux-Fan <ma_sys...@web.de> wrote: > riveravaldez writes: > >> I have this `phwmon.py`[1] which I use with fluxbox to have a couple >> of system monitors at hand. It depends on some python2 packages, so >> stopped working some time ago. > > Any specific reason for preferring `phwmon.py` over a tool like `conky`?
Hi, Linux-Fan, thanks a lot for your answers. `conky` is great, but you have to see the desktop to see `conky`, and I tend to work with maximized windows. Monitors like `phwmon.py` or the ones that come by default with IceWM for instance are permanently visible in the sys-tray/taskbar (no matter you're using fluxbox, openbox+tint2, etc.). That's the only reason: minimal and visible. >> I've just made it work, installing manually (# apt-get install >> packages.deb) >> this packages that I've downloaded from Debian OldStable official >> archives: >> >> python-psutil >> python-is-python2 (this is in fact in Testing) >> python-numpy >> python-pkg-resources >> python-cairo >> libffi6 >> python-gobject-2 >> python-gtk2 >> >> Therefore, my questions: >> >> How safe is this? > > IMHO it's pretty OK because that is quite similar to having upgraded from an > old system with the legacy packages installed to a new release where they > are no longer part of. Thanks! >> Is it better to install them as I did, or adding the corresponding line >> in >> sources.list and pull them from there? Is there any difference? > > There are differences: Whenever you install packages, you may not notice > that they are only avaliable in old releases because the output of > `apt-cache search` and similar tools will include old packages. Also, > running a release with stable+oldstable in sources.list is less common than > the other case: stable in sources.list and some oldstable packages leftover > from upgrades. In case bugs are fixed in the oldstable package, you will get > them automatically if you have them in sources.list. > > My personal choice would be to install the packages without adding the > oldstable repositories as to be reminded that they are obsolete and are > likely to stop working in the future. Thanks again. Very informative and educational. When you say 'as to be reminded that they are obsolete', how/when/where the system will remind me this?, will it be? > Be aware that libraries like `python-psutil` may not work with newer > kernels. Here (on oldstable with a backported kernel 5.10) the script would > > not run due to excess fields reported by the kernel for disk statistics: > > | $ ./phwmon.py > | Traceback (most recent call last): > | File "./phwmon.py", line 341, in <module> > | HardwareMonitor() > | File "./phwmon.py", line 128, in __init__ > | self.initDiskIo() > | File "./phwmon.py", line 274, in initDiskIo > | v = psutil.disk_io_counters(perdisk=False) > | File "/usr/lib/python2.7/dist-packages/psutil/__init__.py", line 2131, > in disk_io_counters > | rawdict = _psplatform.disk_io_counters(**kwargs) > | File "/usr/lib/python2.7/dist-packages/psutil/_pslinux.py", line 1121, > in disk_io_counters > | for entry in gen: > | File "/usr/lib/python2.7/dist-packages/psutil/_pslinux.py", line 1094, > in read_procfs > | raise ValueError("not sure how to interpret line %r" % line) > | ValueError: not sure how to interpret line ' 259 0 nvme0n1 42428 > 17299 3905792 8439 49354 7425 3352623 15456 0 48512 26929 43429 11 476835656 > 3033 0 0\n' Yes, indeed. I didn't mentioned it but I had to "fix" that as seen in: https://gitlab.com/o9000/phwmon/-/issues/3#note_374558691 Essentially, convert: `elif flen == 14 or flen == 18:` to `elif flen == 14 or flen == 18 or flen == 20:` In /usr/lib/python2.7/dist-packages/psutil/_pslinux.py Supposedly shouldn't be problematic, but I'm not sure. Any comment on this? > See also: https://forums.bunsenlabs.org/viewtopic.php?id=967 Thanks. Checked. > [...] > >> [1] https://gitlab.com/o9000/phwmon > > Btw. it looks as if `python-is-python2` is not needed for this to run? > `phwmon.py` states `python2` explicitly. Probably, not sure. But if I'm remembering properly it was pulled as a dependency's dependency. > HTH > Linux-Fan > > ΓΆΓΆ > > PS: If you are interested in my thoughts on status bars, see here: > https://masysma.lima-city.de/32/i3bar.xhtml Thanks a lot, LF! I'm checking it right now. Very interesting. Best regards.