Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - brad.edmondson

#1
Tutorials and FAQs / Install htop process monitor
November 17, 2019, 01:36:44 AM
The classic top process monitor just doesn't cut it for me. I prefer htop, with processor & memory graphs, sorting options (including tree), and commands/keys called out in the UI (see attached).



You can install htop on Opnsense from the FreeBSD ports tree. Note that this takes up a lot of space; 3gb for me (1.2gb for ports, 1.7gb for src). On *Opnsense 21.1.2*, I had to do the following:

grab the ports tree, plus tools and source to compile from it:
# opnsense-code tools ports src

Switch source to current version:

# cd /usr/src
# git checkout stable/21.1


install dependencies:

#  pkg install autoconf automake libtool


I installed these as part of troubleshooting the htop install process (I tried resolving the build errors , so I'm not sure whether they would be automatically installed if you skip this step. If you try it out, let me know!)

Install htop:

# cd /usr/ports/sysutils/htop
# make install clean






2021-02-23 Update: changed make command to "make install clean" and updated source tree for v21.1: "# git checkout stable/21.1". Validated this works for me as of 2021-02-23 on OPNsense 21.1.2.



2022-03-07 Update: After upgrading to OpnSense 22.1, htop was still installed, but would not launch (this is expected due to library version changes). To get htop working again, I had to remove and reinstall it per the following:

update sources for tools and src repos:
# opnsense-code tools src

attempt to update ports tree:
#  opnsense-code ports
that didn't work for me, dying halfway through with a git error about "invalid distance" "too far back" for one of the objects.

Instead, I uninstalled all previous ports and removed the ports tree under /usr/ports. List installed ports by asking pkg to tell us which installed packages do not come from the OpnSense repository (those that do end with the repo string " OPNsense" so grep -v functions as a logical *not*:
# pkg query --all '%o %R' | grep -v '\ OPNsense$'
sysutils/htop unknown-repository
net/arping unknown-repository


Remove each non-OpnSense-precompiled package, e.g.:
# cd /usr/ports/sysutils/htop && make deinstall && make clean
# cd /usr/ports/net/arping && make deinstall && make clean

Remove the ports tree entirely:
# rm -rf /usr/ports/

Fetch the ports tree anew:
# opnsense-code ports

Switch source to current version:

# cd /usr/src
# git checkout stable/22.1


install dependencies if needed (if not needed, pkg will just let you know they're already the latest version):

#  pkg install autoconf automake libtool


Install htop:

# cd /usr/ports/sysutils/htop
# make install clean


After that, htop is working beautifully again! Thanks OpnSense team!