Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing htop eg makeing it show uptime and interface info's #523

Open
blub4747 opened this issue Feb 11, 2021 · 3 comments
Open

Customizing htop eg makeing it show uptime and interface info's #523

blub4747 opened this issue Feb 11, 2021 · 3 comments
Labels
support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.

Comments

@blub4747
Copy link

blub4747 commented Feb 11, 2021

hello community,

I am trying to tell htop show additional information like the uptime and interface information such as.
IP address and interface stats. Like seen in other examples such as armbian. I did try to replicate their example on my xubuntu without any luck.

maybe someone can please tell me where I am going wrong
Thx, to everyone
blub4747

Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=1
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=1
highlight_threads=1
tree_view=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_zero=0
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
delay=15
left_meters=AllCPUs Memory Swap CpuFreq CpuTemp
left_meter_modes=1 1 1 2 2
right_meters=OSversion Hostname Tasks LoadAverage Uptime Eth0 Eth0stat
right_meter_modes=2 2 2 2 2 2 2
# SBC hardware and Kernel specific path.
# Editable manually.
BoardName=
CpuFreq_handler=
CpuTemp_handler=
CpuVCore_l_handler=
CpuVCore_b_handler=
GpuVCore_handler=
GpuTemp_handler=
# Wlan / Eth alias
enp0s25_alias=enp0s25
#eth0_alias=eth0
#eth1_alias=
wlan0_alias=
wlan1_alias=
@BenBE BenBE added the support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead. label Feb 11, 2021
@psztoch
Copy link

psztoch commented Apr 15, 2021

Armbian uses old htop version 2.2.0 with custom patches.

These patches are published here:
https://github.com/armbian/build/tree/master/packages/extras-buildpkgs/htop/debian/patches

CPU/GPU temperature, frequency, Vcore are very useful.
Disk/MMC/Ethernet stats are useful, too.

Bigger part of armbian patches should be integrated with mainstream htop IMHO.

@BenBE
Copy link
Member

BenBE commented Apr 15, 2021

Scrolling through the patches the major one with stuff that looks interesting is https://github.com/armbian/build/blob/master/packages/extras-buildpkgs/htop/debian/patches/avafinger-cpu-monitor.patch

Unfortunately there are several issues (list incomplete):

  • CPU meter already implemented, including temperature/frequency)
  • Block Device IO meter might be a good addition, patches welcome
  • The Block Device IO meter code would need to be rewritten to be DRY
  • Debug/test code from CRT.c's CRT_init shouldn't be in production patches
  • All those additional colors are cluttering the namespace. Won't even make sense if my interfaces are eth2, ens5p2 or lxcbr2
  • For the GPU temp meter see Add GPU utilization meter #406
  • Kernel/OS version is already included in [#480] SysarchMeter to view kernel version/arch info #493 / SysArchMeter: read os-release instead of running lsb-release #533
  • Some files contain old auto-generation comments that need to be cleaned
  • Those plain strcpy in Settings.c are evil (classic heap buffer overflow)
  • Several places with whitespace at EOL
  • Interfaces.c is missing a copyright header
  • The strcpy in ReadKeyValue and ReadTokenValue can also be exploited for buffer overruns trivially (missing length checks)
  • The Vcore code looks interesting, but should better be rewritten to use libsensors.
  • Why is there WIN32 defines in a Linux platform header file?

In recent releases of htop we increased the possibilities of the Meters interface quite a bit and thus for a network or blockdevice meter for a particular device that device should use the proper interfaces provided in those recent versions. Please compare with our dev branch.

@BenBE
Copy link
Member

BenBE commented Apr 18, 2021

Due to the quality (or better lack thereof) of the downstream patch, I recently notified the Armbian maintainers about several security issues in their downstream patch series. And while the proposed patch looks like it may address the most obvious problems, there's still quite a list of things to work on.

That being said, we'll not be taking these downstream patches to implement those features: That just wont meet our quality standards at all.

FWIW: Cross-referencing here, for the Armbian guys to have a cross-reference with the other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support request This is not a code issue but merely a support request. Please use the mailing list or IRC instead.
Projects
None yet
Development

No branches or pull requests

3 participants