Htop with OpenVZ CTID Support

Magiobiwan

Insert Witty Statement Here
Verified Provider
Because I'm lazy, I'm just copy/pasting what I typed up for LET earlier.

Just in case there are people out there who haven't discovered the wonders of htop yet, and if those people happen to run OpenVZ nodes, here's something for you: You can compile htop with OpenVZ Support, allowing you to have the CTID of a process show up by it in the nice wonderful output from htop. I put together a little script to automate the process for CentOS, and with a few minor tweaks it could suit Debian, Ubuntu, etc. (just needs yum changed to apt-get). The script I put together is located at: http://eevee.unovarpgnet.net/htop.sh, and basically what it does is:

  1. Downloads the latest (1.0.2) htop source tarball (located on my server, since SourceForge has the wonderful timestamping, etc. in their links which drive wget nuts).
  2. Makes sure you have gcc and ncurses-devel installed (which are needed for compilation).
  3. Runs ./configure --enable-openvz to enable OpenVZ stuff in htop.
  4. Removes a pre-installed htop version.
  5. Compiles and installs your custom-built htop.
To show the CTID in htop, press F2 while it's running, then under "Columns" scroll down until you see "CTID" and press F5 while CTID is highlighted to add it to the view. I prefer to put it before PID, personally. Then press F10 twice to properly exit htop so that your config changes are saved. Happy abuse squashing!
 

NickM

New Member
Verified Provider
htop in Debian (both squeeze and wheezy) already have this built in and enabled.
 

Magiobiwan

Insert Witty Statement Here
Verified Provider
Interesting. Good to know. The RPMs for CentOS don't have it enabled by default, so you have to compile it in yourself. 
 

john

New Member
Verified Provider
It's in EPEL and RepoForge. I use the one in EPEL and it has OpenVZ support. 
 

Magiobiwan

Insert Witty Statement Here
Verified Provider
Interesting. Didn't know that the EPEL RPM had it enabled. I mainly use the RPM from repoforge. I'll make an even more customized version of it with some other useful flags enabled tonight.
 
Top