Categories
Cacti Linux Sys Admin VMWare

Monitoring VMWare’s Free ESXi 3.5 with Cacti

Monitor the free VMWare ESXi 3.5 with Cacti to keep historical data based on CPU Utilisation and Memory Usage over time.

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:

24 replies on “Monitoring VMWare’s Free ESXi 3.5 with Cacti”

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?

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?

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?

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

@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!

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.

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.

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?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.