Home > Cacti, Linux, Sys Admin, VMWare > Monitoring VMWare’s Free ESXi 3.5 with Cacti

Monitoring VMWare’s Free ESXi 3.5 with Cacti

When I realised that the free version of VMWare ESXi only kept an hours worth of logging information I went looking for a solution to keep more statistical data. This is what I have come up with so far.

VMWare ESXi 3.5 CPU Graph in Cacti

VMWare ESXi 3.5 CPU Graph in Cacti

VMWare ESXi 3.5 Memory Graph in Cacti

VMWare ESXi 3.5 Memory Graph in Cacti

This method uses the VMWare Remove CLI tools to connect to the ESX server and download the information via an XML interface.

Software Required:

Firstly download and install the VMWare Remote CLI tools to your Cacti server.

Next you need to add a user to ESX for the statistics collection.

On the ESX Virtual Infrastructure Client goto the “Users & Groups” tab.

VMWare ESXi 3.5 Add Stats User Step 1

VMWare ESXi 3.5 Add Stats User Step 1

Right Mouse Click and “Add” a new user.

VMWare ESXi 3.5 Add Stats User Step 2

VMWare ESXi 3.5 Add Stats User Step 2

Then go to the “Permissions” tab, and Right Mouse Click to “Add Permission”.

VMWare ESXi 3.5 Add Stats User Step 4

VMWare ESXi 3.5 Add Stats User Step 3

Add the new StatsUser and select Read-Only for the assigned role and click Ok.

Now goto your Cacti installation and copy the “esxstats.pl” file into your cacti scripts directory and import the “cacti_host_template_vmware_esxi_3_5_host.xml” file into Cacti using the web interface. These scripts can be downloaded from the bottom of this post.

You should now be able to add a new ESX host into cacti. You will need to specify the “Downed Device Detection” mode to just “Ping” as there is no SNMP on the current Free version of VMWare ESXi 3.5.

I am hoping that SNMP support will come to the free versions as that would make life much easier.

Files Required:

Categories: Cacti, Linux, Sys Admin, VMWare Tags: , , , ,
  1. David Strong
    May 7th, 2009 at 14:45 | #1

    Cheers, works a treat. Exactly what i was looking for.

  2. CALF
    May 14th, 2009 at 21:05 | #2

    Error: XML: Hash version does not exist

    on templates importing…

  3. May 14th, 2009 at 21:09 | #3

    I really like Cacti, but this is one of my biggest bugbears. If you try to import a template on an older version you get the error stated above.

    The template should import on version 0.8.7d. What version are you using?

  4. CALF
    May 14th, 2009 at 21:34 | #4

    Nagios 0.8.7d
    Perl 5.8.8

  5. CALF
    May 14th, 2009 at 21:37 | #5

    Sorry. My cacti version is 0.8.7b. Thanks for fast answers and congratulations for monitoring solution…

  6. Mike B
    July 1st, 2009 at 06:48 | #6

    I got everything into cacti great and configured but nothing was showing up. running it from commandline:

    root@cacti:/usr/share/cacti/site/scripts# perl esxstats.pl 10.1.10.14 StatsUser statsuser
    Error: Server version unavailable at ‘https://10.1.10.14/sdk/vimService.wsdl’ :1: parser error : Start tag expected, ‘<' not found

    is what i get, any suggestions?

  7. July 1st, 2009 at 09:26 | #7

    Mike B :

    I got everything into cacti great and configured but nothing was showing up. running it from commandline:

    root@cacti:/usr/share/cacti/site/scripts# perl esxstats.pl 10.1.10.14 StatsUser statsuser
    Error: Server version unavailable at ‘https://10.1.10.14/sdk/vimService.wsdl’ :1: parser error : Start tag expected, ‘<’ not found

    is what i get, any suggestions?

    What is the version of ESX you are using? Free version or Licensed?

  8. Mike B
    July 1st, 2009 at 12:54 | #8

    @Jon Smith
    Its the Free version, VMware ESX Server 3i, 3.5.0,153875 i can hit that url and its a rather short and sweet XML page. I’ve been scratching my head for a couple of days on it now.

  9. July 1st, 2009 at 13:25 | #9

    @Mike B
    Mike, I have done some googling about your problem and it seems like you might be missing a Perl module. Try installing “Crypt::SSLeay”.

    Source: http://communities.vmware.com/thread/164134?tstart=0 (on page two, first post)

    Good luck

  10. Mike B
    July 1st, 2009 at 13:53 | #10

    @Jon Smith
    Dead on, that was the hang up! Thanks so much, I thought I installed that module, but alas that was the issue. Great script, works perfectly and thanks again!

  11. PT
    July 28th, 2009 at 23:05 | #11

    @Jon Smith
    Will this work with ESX 3.5 Licensed version? cheers

  12. July 29th, 2009 at 08:21 | #12

    @PT
    To be honest I don’t know. In theory it should, it would be great if you could test it and let us know.

  13. feilong
    August 7th, 2009 at 01:53 | #13

    I have just test on a ESX 3.5 Licenced version and it’s working fine.
    I have just test on a ESXi 4 version and it’s working fine.

    Thanks for share.

  14. tapankar
    August 12th, 2009 at 22:17 | #14

    I am trying to import the XML file but getting “XML parse error”.I am using cacti 0.8.7e..Could you help…

  15. August 13th, 2009 at 10:33 | #15

    @tapankar
    Hrm, new version of Cacti out. I will try the import after I have upgraded my installation. Once upgraded I will release a new version made for 0.8.7e, this wont be until early next week.

  16. Mohit
    November 13th, 2009 at 05:44 | #16

    Thanks !! But is it possible for you add bandwidth monitoring also with this

  17. November 19th, 2009 at 08:29 | #17

    @Mohit
    Not currently. The last time I looked, this information was not easy to obtain.

    Cheers,

    Jon

  18. Lalbee99
    December 15th, 2009 at 01:50 | #18

    I loaded this using cacti 0.8.7e and it works. I did change the perl script to be more robust. I added functions for mem & cpu reporting on a singular vm or on the cluster itself, by passing command line arguments. I then re wrote the templates for mem & cpu to reflect this change.

  19. December 15th, 2009 at 08:00 | #19

    @Lalbee99
    Any chance you would be happy to share your work back to the community? Sounds like a great improvement.

    Cheers,

    Jon

  20. Chungyih
    May 27th, 2010 at 12:41 | #20

    I got everything into cacti great and configured but nothing was showing up. running it from commandline:
    /usr/share/cacti/site/scripts# perl esxstats.pl

    BEGIN failed–compilation aborted at esxstats.pl line 7.

    is what i get, any suggestions?

  1. No trackbacks yet.