Thursday, May 17, 2012

Esxtop 4/4 – scheduling esxtop.

We’ve reached our final post about esxtop.

If you missed some of them here are the references:
Esxtop 1/4 – esxtop basics
Esxtop 2/4 – accessing esxtop remotely
Esxtop 3/4 – exporting the data you collected

You might face a situation where some performance degradation occurs just during the evening or during weekends, well, nobody likes to stay up all night or work during a weekend just to run one line of command to generate a performance output for later analysis.

So, it’s good to have the option to schedule a task in ESXi to run esxtop, collect the data and save for your later analysis.

With ESX classic, where we had a Service Console, it was no different than Unix/Linux systems, just run: crontab –e 
That would be it, just add your job, save it and you are all set.

Now with ESXi, cronjob is limited in shell console. Let’s see how to set it up, though

- log into the host with SSH.
- edit the file /var/spool/cron/crontabs/root
- add your job, save and close the file
- kill the cron daemon running: kill $(cat /var/run/
-  restart the cron daemon running: busybox crond
Easy, right ?  Your job will run at the specific time you set up.
Here’s a quick reference about the cron jobs syntax:

mm hh dd MM ww “job_goes_here”

mm = minutes
hh = hours
dd = day of month
MM = Month
WW = Day of Week

I hope it helps you when dealing with esxtop tasks.

Friday, May 4, 2012

Esxtop 3/4 – exporting the data you collected

Last post you learned how to check the performance data of your hosts, but that was an interactive way, there’s not way to create a historical analyses based on that or even create graphical representation with the data.

So, how do you export performance data from ESXi for a more in depth analysis ?!?

First, let’s generate a .CSV file with the performance data you want.

Make sure you configure esxtop to gather just the metrics will want otherwise your .CSV file will be huge. (Check the esxtop basics to learn how).

Then run esxtop in batch mode.
esxtop –b –d 10 –n 6 > /tmp/log.CSV

-b stands for batch mode
-d stands for delay, it means every X seconds it will capture the data
-n is the number of interactions, it means how many captures it will make

on the example above it will capture the data 6 times, one at every 10 seconds, summarizing 60 seconds of data and saving it on /tmp/log.CSV

Now that you have your file, copy it to a desktop where you can read this data.

Once the file is in your desktop you have a few options to read it:

-       Excel
-       Perfmon
-       Esxplot

Since it’s a .CSV file you could import into Excel and work yourself with the data to create the graphics you want. It can be challenge and also Excel has a limitation, the number of lines, so if your file is big enough Excel could not handle that.
-       Open Excel
-       Select File/Import
-       Select CSV File and then browse to the file with your data.

Another option is to use perfmon, most Windows administrators are familiarized with this tool and would have no problems with that.  Also perfmon has limitations, it could take a long time loading all the information from your file.
-       Open Perfmon
-       Select Source tab
-       Change to log files
-       Cick Add then browse to the file with your data.

Another great tool it esxplot, since it has been build specific to work with ESX logs, it has the better performance and can read enormous amount of data, once it’s installed you just need to select your .CSV file to start seeing the data.

I bet you are anxious to start grabbing some data for analysis, right ; )

Who am I

My photo
I’m an IT specialist with over 15 years of experience, working from IT infrastructure to management products, troubleshooting and project management skills from medium to large environments. Nowadays I'm working for VMware as a Consulting Architect, helping customers to embrace the Cloud Era and make them successfully on their journey. Despite the fact I'm a VMware employee these postings reflect my own opinion and do not represents VMware's position, strategies or opinions. Reach me at @dumeirell

Most Viewed Posts

Blog Archive