Xentop and Long Server Names

0
July 15, 2014 at 3:01 am  •  Posted in Xenserver by  •  0 Comments

Oh Xenserver, how I love you.  Seriously, check out this list to see how awesome Xenserver  is:

  1. Amazing hypervisor with great hardware support
  2. Built on a solid Linux core
  3. Provides a tool like Xentop which cuts off long server names!

Ok, maybe number three isn’t so great, but I aim to fix that.

Xentop and Long Server Names – The Problem

By default the column size for the name field is 10 characters. That means when I have a server naming convention that starts with a 10 character pre-appended string, all the server names in Xentop are completely useless. Luckily a fix is readily available.

A quick search of the Google machine will render the following bugzilla bug. It provides two pretty simple fixes.

  1. RunXentop with-b
    1. This works! However, you lose that top like behaviour that most people seem to enjoy.
  2. Change the format from %10.10 to %20.20 in the print_name function inxentop.c
    1. This is my favorite as it resolves the problem and you get to keep the console refreshing behaviour of top!

Xentop and Long Server Names – The Fix

If you used the -b option and are happy, then you may not care about the rest. If the idea of editing xentop.c scares you, don’t worry this is going to be quick, simple, and you won’t even open vi.

  1. Create a backupofyouroriginalxentop. (Justin case)
    1. cd /usr/sbin
    2. cp xentop{,.bak}
  2. Run a simple sed command on the original.
    1. sed -i ‘s/10\.10/20\.20/g’ xentop
  3. Run Xentop, your server names should show 20 characters.

You could go a little wider on the column size by replacing 20\.20 with a higher number. But if you didn’t notice, the formatting is off just a little bit at 20 characters. I can only imagine that how much worse it can get.

 

 

Tags:

Leave a Reply