htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.31k stars 424 forks source link

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

Open blub4747 opened 3 years ago

blub4747 commented 3 years ago

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=
psztoch commented 3 years ago

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 commented 3 years ago

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):

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 commented 3 years ago

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.