XenServer & Command Line Tools

Standard

XenServer 6.x comes with Linux-based tools to assist with Administrative tasks, troubleshooting, and so forth.  However, in both my own private and test labs, well… I get a bit needy.  Spoiled?  Maybe.  Needy?  Probably.  Trying to lean on tools I’ve used over my career within Linux?  Yup.

The following tools are some of my favorites to use (for various reasons) and all involve using yum.  From XenServer 6.1 and beyond, these pretty much install without issue.

Now, before I continue:

As this is from my own personal lab, follow at your own peril or gain.


traceroute

XenServer comes with an alternative – tracepath – by default.  To install traceroute, simply execute:

yum –enablerepo=base install traceroute -y

In a matter of a few seconds, you’ll have the more recognized utility installed and ready to test:

[root@JJ ~]# traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 40 byte packets
 1  10.0.0.1 (10.0.0.1)  10.375 ms  4.400 ms  15.866 ms
 2  96.120.4.29 (96.120.4.29)  45.607 ms  47.699 ms  45.326 ms
 3  somewhere.secret.net (8.8.1.1)  47.218 ms  47.084 ms  46.927 ms
 4  23.30.207.254 (23.30.207.254)  26.551 ms  31.305 ms  34.446 ms
 5  216.239.51.39 (216.239.51.39)  27.400 ms 216.239.51.21 (216.239.51.21)  29.097 ms  27.537 ms
 6  216.239.51.243 (216.239.51.243)  43.472 ms 209.85.142.140 (209.85.142.140)  31.467 ms 64.233.175.32 (64.233.175.32)  35.817 ms
 7  209.85.143.193 (209.85.143.193)  33.550 ms 209.85.143.201 (209.85.143.201)  35.467 ms 64.233.174.133 (64.233.174.133)  25.650 ms
 8  google-public-dns-a.google.com (8.8.8.8)  29.244 ms  21.583 ms  19.853 ms

For more information on traceroute, check out http://linux.die.net/man/8/traceroute.


iptraf

This is a really nifty, interactive tool with interactive and logging capabilities.  As the name implies, it displays traffic in real-time and allows for many other configuration options, as well.

yum –enablerepo=base install iptraf -y

By simply running iptraf, you can configure it as well as watch all IP interfaces (including VIFs):

iptraf

For more information regarding iptraf, check out http://linux.die.net/man/8/iptraf.


lsof

Short for “list of open files”, this tool comes in pretty hand when trying to identify what has what open, how long, and more.

yum –enablerepo=base install iptraf -y

Much more explaining the massive capabilities of this tool can be found at http://linux.die.net/man/8/lsof.


vnstat

Another network monitoring utility, it also has capabilities to setup timers while monitoring an interface.

yum –enablerepo=base install vnstat -y

One can specify an interface (-i eth0) or one can simply run vnstat -l.  As an example of watching eth0 for a minute or so, after hitting control+c you get quite a simple, nifty output of stats:

[root@JJ ~]# vnstat -l
Monitoring eth0...    (press CTRL-C to stop)

   rx:       1.26 kB/s    12 p/s            tx:      13.60 kB/s    16 p/s^C


 eth0  /  traffic statistics

                             rx       |       tx
--------------------------------------+----------------------------------------
  bytes                        60 kB  |       1.90 MB
--------------------------------------+----------------------------------------
          max              6.34 kB/s  |   260.58 kB/s
      average              2.52 kB/s  |    80.97 kB/s
          min              0.40 kB/s  |     5.27 kB/s
--------------------------------------+----------------------------------------
  packets                        724  |          1604
--------------------------------------+----------------------------------------
          max                 82 p/s  |       185 p/s
      average                 30 p/s  |        66 p/s
          min                  5 p/s  |         6 p/s
--------------------------------------+----------------------------------------

More information on this network analysis tool can be found at http://linux.die.net/man/1/vnstat.


dstat

Colorized, compact, and also real-time, dstat gives a nice output of sysem resource usage in an incremental basis.

yum –enablerepo=base install dstat -y

By simply running dstat from the command line for as long as you want, you get an output such as this:

dstat

For more information regarding dstat, check out (yet again) http://linux.die.net/man/1/dstat.


iptstate

For security or just out of curiosity, iptstate is the “top” of IPTables.

yum –enablerepo=base install iptstate -y

It runs until you enter control+c and its output – updated incrementally in real-time – looks as follows:

IPTables - State Top
Version: 1.4Sort: SrcIPs to change sorting
SourceDestination             Proto   State        TTL    28
10.0.0.1224.0.0.1igmp0:08:36
10.0.0.50:13810.0.255.255:138udp0:00:16
10.0.0.51:13810.0.255.255:138udp0:00:17
10.0.1.10:5460810.0.0.51:445tcp     ESTABLISHED  119:59:58
10.0.192.236:5219910.0.1.10:443tcp     ESTABLISHED  119:59:59
10.0.192.236:5392910.0.1.10:443tcp     ESTABLISHED  120:00:55
10.0.192.236:5220110.0.1.10:443tcp     ESTABLISHED  119:59:54
127.0.0.1:37258127.0.0.1:80tcp     TIME_WAIT0:00:58
127.0.0.1:39545127.0.0.1:123udp0:01:08
127.0.0.1:36619127.0.0.1:80tcp     ESTABLISHED  119:59:59
127.0.0.1:37247127.0.0.1:80tcp     ESTABLISHED    0:05:07
127.0.0.1:46727127.0.0.1:123udp0:02:58
127.0.0.1:36620127.0.0.1:80 tcpESTABLISHED  119:59:55
127.0.0.1:37262127.0.0.1:5901tcp     ESTABLISHED  119:59:59
172.0.0.2:1018 172.0.0.5:2049tcp     ESTABLISHED  119:59:57

Quite a swell tool, I’d say and more information about it can be found at http://linux.die.net/man/8/iptstate.


collectl

Last up, another real-time, incrementing utility to show CPU, Disk, and Network activity.

yum –enablerepo=base install collectl -y

The output comes in 1 second sequences by default, such as:

[root@JJ addTools]# collectl
waiting for 1 second sample...
#<--------CPU--------><----------Disks-----------><----------Network---------->
#cpu sys inter  ctxsw KBRead  Reads KBWrit Writes   KBIn  PktIn  KBOut  PktOut 
   7   4   298   6477      0      0      4      1      3     51    251     171 
   7   6   306    897     48      2      0      0      5     59    265     185 
  55  45  1154   2264      4      1      0      0      9     84    260     204 
  12  11   317    861      0      0      0      0      3     52    251     171 
   1   1   225    709      0      0      0      0      4     58    257     178 
   2   1   346    868      0      0     20      3      5     71    251     173 
  10   7   264   6813      0      0      0      0      4     68    251     173 
   4   4   361   1068      0      0   1858     53      6     71    269     200 
   1   1   318    817      0      0      8      2      5     73    253     192 
   1   1   209    691      0      0      0      0      5     61    258     183 
   0   0   231    685      0      0     20      3      3     50    251     171 
   5   5   262    800      0      0      0      0      3     51    251     170 
   3   3   450    952      0      0    277     53      3     51    252     174 
Ouch!

 

So, for sure there are more tools to discuss for Administrators looking for light weight methods to gain powerful metrics, but for now… enjoy!

–jkbs | @xenfomation | XenServer.org | My Blog

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s