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)

Installation:

1. Deploy VMware vMA from URL:  http://download3.vmware.com/software/vma/vMA-4.1.0.0-268837.ovf
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.

25 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.

    regards
    Russ

  3. admin says:

    Russ,
    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?

    Lars

  4. roconnor says:

    Yeap, once I used sudo the modules installed

    thanks

  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) ?

    regards
    Russ

  6. admin says:

    Russ,
    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

    Lars

  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 1.1.1.1 is the server in question):

    [root@ABG-vMA vmktree-0.4.1]# /usr/bin/vmktree-esx4-collector 1.1.1.1 root
    ERROR: creating ‘/var/www/vmktree-data/sys/1.1.1.1/vmkernelmem.rrd’: 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.
    Michael

  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?

  14. admin says:

    Open the file /etc/vmktree.conf in your favorite text editor and verify
    that the path is correct for the variable location data. On debian it should be:

    location.data:=/var/lib/vmktree

    Correct it if it’s wrong and save the file. Wait a few minutes and see if you get any graphs.

  15. edegrave says:

    Hi Lars,

    Brilliant! That fixed it. Good little project for a blogpost!

    Regards

  16. edegrave says:

    Oops, spoke a bit too soon. The servers and vms show up but the graphs show as a red cross in the browser.
    I see I have no /var/www/cgi-bin dir
    Did I miss a dependency and did a script not install due to the missing location?

    Regards

  17. edegrave says:

    Graphs showing!

    location.data:=/var/lib/vmktree
    location.www:=/var/www/vmktree

    Should the location.cgi be =:/usr/lib/cgi-bin or /usr/lib/cgi-bin/vmk?

    Regards

  18. admin says:

    On debian location.cgi should be:
    location.cgi:=/usr/lib/cgi-bin

    Lars

  19. edegrave says:

    Before I forget: brilliant and easy to use. Thanks for making this available!

  20. kcmjr says:

    Just an FYI. The SSH password-less logon is broken on ESXi5 hosts.

  21. kcmjr says:

    This article discussed the differences. The addesx and collector scripts will need to be adjusted to conform to the items in the article. http://www.virtuallyghetto.com/2011/07/ssh-keys-lockdown-mode-caveat-in-esxi-5.html

  22. Subversive says:

    Hi, I am trying to get this running. I’ve run the wget to download the file, but when I run “tar xvf vmktree-0.4.1.tar.bz2”, I get “tar: invalid tar magic”. (Had to omit the J as I get invalid option –j if I leave it in).

    I’m not really a linux guy at the heart of things, is there something I’m missing here?

  23. shin says:

    Hi, this tools will receive a upgrade to vsphere 5.XX. You are interisted on help on it.

    Regards

Leave a Reply