Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
htop with OpenVZ Support
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

htop with OpenVZ Support

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!

BlueVM | Best VPS Deals [~] 1GBPS, RAID-10, OpenVZ/KVM, 8 locations. [~] Feathur VPS Control Panel!

Comments

  • trewqtrewq Administrator, Moderator, Provider

    You are amazing.

  • RaymiiRaymii Member

    Nice one. Can use this myself

    Quis custodiet ipsos custodes?
    https://raymii.org - https://cipherli.st
  • I'll be refining my script so it has comments and stuff in it. It may seem like this is a small thing to have, but it's VERY useful when you want to know who to suspend for running a port scanner script, etc.

    BlueVM | Best VPS Deals [~] 1GBPS, RAID-10, OpenVZ/KVM, 8 locations. [~] Feathur VPS Control Panel!
  • johnjohn Member

    The one in EPEL also has OpenVZ support :).

    garrisonhost.com
  • One from Debian repos (1.0.1 from testing) also appears to support this (it has CTID column as available, though can't check if it really shows it)

  • If the column is available, then it was compiled with OpenVZ support.

    BlueVM | Best VPS Deals [~] 1GBPS, RAID-10, OpenVZ/KVM, 8 locations. [~] Feathur VPS Control Panel!
  • jmginerjmginer Member, Provider

    cd ~;

    wget downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz;

    yum install -y ncurses-devel gcc make;

    tar xvzf htop-1.0.2.tar.gz;

    cd htop-1.0.2;

    ./configure --enable-openvz;

    make;

    make install;

    htop;

    Thanked by 1Gsitterly
    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • DamianDamian Member

    @Magiobiwan said:
    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!

    Also in those same columns are IO_READ_RATE and IO_WRITE_RATE, also great for abuse squashing.

Sign In or Register to comment.