Jump to content

Run Htop on Web Browser


Recommended Posts

Here are the instructions to run Htop remotely using a web browser.

I often use Htop to monitor the health of my boards and servers (amd64). It is a good tool for the sys admin to monitor the servers in real-time without much resources and it is not very intrusive.

 

 

Recipe

 

1 - Clone shellinabox

 

root@cubieboard2:~# git clone https://github.com/shellinabox/shellinabox
Cloning into 'shellinabox'...
remote: Enumerating objects: 3073, done.
remote: Total 3073 (delta 0), reused 0 (delta 0), pack-reused 3073
Receiving objects: 100% (3073/3073), 4.31 MiB | 1.89 MiB/s, done.
Resolving deltas: 100% (2418/2418), done.
root@cubieboard2:~# cd shellinabox/


 

2 - Build and install shellinabox

 

shellinabox makefile is outdated for OpenSSL 1.1.y, so we need to bypass the linking process and do it manually.

During the config process you get some errors, bypass the error by doing like so:


 

root@cubieboard2:~/shellinabox# apt-get install libtool

root@cubieboard2:~/shellinabox# autoreconf -i
root@cubieboard2:~/shellinabox# autoconf
root@cubieboard2:~/shellinabox# autoreconf -i

root@cubieboard2:~/shellinabox# ./configure

root@cubieboard2:~/shellinabox# make


 

 

3 - Bypass the linking error

 

During the link process you get a missing openssl 1.1 lib, we then manually link shellinabox:

 

root@cubieboard2:~/shellinabox#  gcc -g -std=gnu99 -Wall -Os -o shellinaboxd shellinabox/shellinaboxd.o shellinabox/externalfile.o shellinabox/launcher.o shellinabox/privileges.o shellinabox/service.o shellinabox/session.o shellinabox/usercss.o  ./.libs/liblogging.a ./.libs/libhttp.a -ldl -lutil -lssl -lcrypto

 

4 - Running Htop on the Browser

 

I choose not to install shellinabox, just run a service to be able to run and make Htop available on the Browser.

Tested on Google Chromium and FireFox (linux).

 

root@cubieboard2:~/shellinabox# ./shellinaboxd -t -b -p 8888 --no-beep -s '/htop_app/:alex:alex:/:htop -d 10'

 

where 8888 is the port.

alex:alex is the user:group to run Htop with. Use yours [user] and [group].

 

Note: for security reason if you run with nobody:nogroup you wont be able to add or change any config on the Htop.

 

Now fire the browser at http://ip_address:8888/htop_app/ and that's it, enjoy.

 

5 - Credits

 

stackverflow, user ofstudio.

 

Screenshot:

chromium.thumb.png.696b82421900e4186f16d09dcef80ea4.png

 

firefox.thumb.png.8c2d515a0b311faf384cd0da2c43a409.png

 

 

Link to comment
Share on other sites

2 hours ago, @lex said:

It is a good tool for the sys admin to monitor the servers in real-time without much resources and it is not very intrusive.

 

I agree.  But doesn't that sort of all go out the window once you start adding all the extra stuff needed to run it in a browser?

 

I guess I don't understand, why not just ssh in and run htop in a regular shell?  I think that is the most light weight of all?

 

I mean, cool toy and all, but light weight?  I guess that's the part where I scratch my head.

 

Thanks for sharing, all the same.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines