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.
This method uses the VMWare Remove CLI tools to connect to the ESX server and download the information via an XML interface.
Software Required:
- Download the VMWare Remote CLI from http://www.vmware.com/go/remotecli
- Cacti http://www.cacti.net/
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.
Right Mouse Click and “Add” a new user.
Then go to the “Permissions” tab, and Right Mouse Click to “Add Permission”.
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:
24 replies on “Monitoring VMWare’s Free ESXi 3.5 with Cacti”
Cheers, works a treat. Exactly what i was looking for.
Error: XML: Hash version does not exist
on templates importing…
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?
Nagios 0.8.7d
Perl 5.8.8
Sorry. My cacti version is 0.8.7b. Thanks for fast answers and congratulations for monitoring solution…
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?
@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.
@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
@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!
@Jon Smith
Will this work with ESX 3.5 Licensed version? cheers
@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.
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.
I am trying to import the XML file but getting “XML parse error”.I am using cacti 0.8.7e..Could you help…
@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.
Thanks !! But is it possible for you add bandwidth monitoring also with this
@Mohit
Not currently. The last time I looked, this information was not easy to obtain.
Cheers,
Jon
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.
@Lalbee99
Any chance you would be happy to share your work back to the community? Sounds like a great improvement.
Cheers,
Jon
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?
Great job. Many thanks for sharing. Works fine on ESXi 4, monitoring from ubuntu.
Just to save some time from others. Running esxstats.pl from command gave the following error:
/usr/local/share/cacti/scripts# perl esxstats.pl
perl: symbol lookup error: /usr/lib/perl/5.10/auto/XML/LibXML/Common/Common.so: undefined symbol: Perl_Tstack_sp_ptr
If you use Ubuntu 10.04.2 LTS you need to install following packages too:
perl-XML-LibXML perl-XML-LibXML-Common perl-XML-SAX perl-XML-DOM perl-XML-Parser perl-XML-RegExp perl-Crypt-SSLeay perl-Data-Dump perl-Class-MethodMaker
By the way, any one knows which ports on firewall should I open for this to work?
Have you tested this on ESXi 5.0 and 5.1?