vmktree 0.4.1 with support for ESX(i) 4.1 is here

Key features:

– Support for 4.1 ESX and ESXi only
– Providing stats for core four of the host (+more). Currently lacking networking stats per VM.
– Supporting many new values provided by ESX 4.1 such as: memory compression, power usage, disk latency, queues, etc….
– Since many new values have been added, the database is not backward compatible with older versions (only parts)


1. Deploy VMware vMA from URL:  http://download3.vmware.com/software/vma/vMA-
2. Start the vMA VM, configure ip, pw, etc. Login as vm-admin
3. Download vmktree: wget vmktree.org/vmktree-0.4.1.tar.bz2
4. tar xjvf vmktree-0.4.1.tar.bz2
5. cd vmktree-0.4.1
6. sudo ./install.pl
7. vmktree-addesx
8. Open your web browser and point to http://ip-or-name-of-vma/vmktree

SSH needs to be enabled so make sure your ESXi hosts have “Remote Tech support (SSH)” enabled.

ESXi hosts loose their ssh keys after reboot so check out this workaround.

Any Debian or RHEL based distro should in theory work.

Have fun!

Update: A few bugs has been reported and fixed since 0.4.0 was released so this posting has been updated to 0.4.1.

15 Responses to “vmktree 0.4.1 with support for ESX(i) 4.1 is here”

  1. […] lost track of vmktree for a while but when I noticed the announcement this week that 0.4.1 was released I decided to give it a spin again. I logged into my vSphere […]

  2. roconnor says:

    Hi Lars,
    Great tool we used to use it on ESX 2,

    I ‘m trying to install on vMA 4.1, but when the install script checks for /usr/bin/rrdtool and calls vmware-vma-41-get_and_install_missing_modules.sh I get stuck. All the ESX servers/vCenters are in management networks – no dhcp, no way to connect to the internet.

    I have tried to install vMA on vmworkstation with internet access and it crashes on boot. I have also tried downloading the missing_modules, placing them on the vMA and running rpm -Uvh libpng*.rpm libart*.rpm freetype*.rpm, rpm -Uvh rrdtool-*.rpm perl-rrdtool-*.rpm, rpm -Uvh perl-IO-Tty*.rpm perl-Expect-*.rpm but that fails with can’t create transacion lock on /var/lib/rmp/__db.000 and failed to make symlink permission denied errros.

    I you have any pointers would be usefull, I suppose what I need to do is find out how to manually install the required modules before running the vmktree install.

    I would imagine others will run into this isssue that why I bring it up.


  3. admin says:

    What you have been trying to do to work around the internet connection issue should work.

    The method I’ve been using is to put the vMA temporary on a network with dhcp and internett connection and run the install script, but downloading the modules manually like you have done here should also work.

    Did you remember to use ‘sudo’ when trying to install the modules?


  4. roconnor says:

    Yeap, once I used sudo the modules installed


  5. roconnor says:

    Hi Lars

    I am unable to add the ESX hosts (ESX 4.1 not ESXi)
    From the vMA I can ssh -l root successfully to the hosts,
    But vmktree-addesx fails

    I specify the root account, etc… it may be that it is timing out before the connection is established, when I ssh it takes over 20 seconds to connect? Should I give the vMA some more memory (currently it has 512 MB) ?


  6. admin says:

    You’re probably right that the connection is timing out.

    This is normally a dns issue. Make sure that you have a reverse lookup zone on your dns server for the subnet where the vMA is located. The ESX servers will try to lookup the name of the ip that is connecting through ssh (for logging purposes).

    As long as the ssh login works seamlessly you can manually start the collector by creating a file /etc/cron.d/vmktree and add a line for each server:
    * * * * * root /usr/bin/vmktree-esx4-collector esx-host-name-or-ip root >/dev/null 2>&1


  7. roconnor says:

    I added a reverse lookup zone, and it works
    Thanks for your help, great tool, much appreciated

  8. Michael says:

    I am following the instructions, and the install seems to succeed.
    vmktree-addesx also seems to add servers successfully. However, no data ever shows up on the graph.
    If I run the collector manually, I get the following error (where is the server in question):

    [root@ABG-vMA vmktree-0.4.1]# /usr/bin/vmktree-esx4-collector root
    ERROR: creating ‘/var/www/vmktree-data/sys/’: No such file or directory
    rrdtool create ‘/var/www/vmktree-data/vm/564d5a6040f1091f-2e12fdd386980be9/swap.rrd’ –start now –step=60 DS:MemoryToSwap:GAUGE:120:0:U DS:SwappedMemory:GAUGE:120:0:U DS:SwapMemoryRead:DERIVE:120:0:U DS:SwapMemoryWritten:DERIVE:120:0:U DS:COWSwapped:GAUGE:120:0:U DS:MaximumAllocated:GAUGE:120:0:U DS:LastAllocation:GAUGE:120:0:U DS:CurrentAllocation:GAUGE:120:0:U RRA:AVERAGE:0.5:1:5760 RRA:AVERAGE:0.5:5:4032 RRA:AVERAGE:0.5:30:1536 RRA:AVERAGE:0.5:90:1536 RRA:AVERAGE:0.5:240:4608
    ERROR: creating ‘/var/www/vmktree-data/vm/564d5a6040f1091f-2e12fdd386980be9/swap.rrd’: No such file or directory
    can’t open state file: No such file or directory at /usr/bin/vmktree-esx4-collector line 923.

    Any help will be appreciated.

  9. Dustin says:

    I’m getting the “can’t open state file” error as well for my ESX “classic” hosts. everything is working fine on my esxi hosts. All hosts are 4.1

  10. Ken says:

    I’ve reinstalled vmktree twice, once today, once when it was originally released. Both installs will accept only 2 of my ESX hosts. I usually SSH into them myself so it’s not that. Any thoughts?

  11. Ken Tam says:

    It is a great tool, we install it for monitoring 3 hosts in our office.
    Is it possible to change the page /graph layout and the VM tree belongs to the corresponding host ?

  12. dhung says:

    Hi Lars,

    I am unable to add any ESXi server, and I keeps getting the error below. Please help.

    [vi-admin@vma1 vmktree-0.4.1]$vmktree-addesx esxiservername.domainname.com
    Can’t locate Expect.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/bin/vmktree-addesx line 10.
    BEGIN failed–compilation aborted at /usr/bin/vmktree-addesx line 10.
    [vi-admin@usalvma1 vmktree-0.4.1]$

  13. edegrave says:

    Hi Lars,

    Installation on Debian runs just fine (after fixing some dependencies). vmktree-addesx works fine as well but graphs wont show up in the webinterface.

    Any pointers to where I should start looking to find the problem?

Leave a Reply