<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David&#039;s technobabble &#187; vmware</title>
	<atom:link href="http://bable.cybermarshall.com/tag/vmware/feed/" rel="self" type="application/rss+xml" />
	<link>http://bable.cybermarshall.com</link>
	<description>David&#039;s thoughts about this and that</description>
	<lastBuildDate>Fri, 22 Jan 2010 18:29:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why virtual machines should be the 1st choice to run your systems</title>
		<link>http://bable.cybermarshall.com/2009/07/02/why-virtual-machines-should-be-the-1st-choice-to-run-your-systems/</link>
		<comments>http://bable.cybermarshall.com/2009/07/02/why-virtual-machines-should-be-the-1st-choice-to-run-your-systems/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 18:30:24 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=726</guid>
		<description><![CDATA[Lately, I&#8217;ve been on phone calls with several companies to discuss whether they should run their applications on virtual machines or physical machines. Typically, some user or software person has been told the plan is to run their application on a virtual machine.  They believe their application is &#8220;so special&#8221; and will not work [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I&#8217;ve been on phone calls with several companies to discuss whether they should run their applications on virtual machines or physical machines. Typically, some user or software person has been told the plan is to run their application on a virtual machine.  They believe their application is &#8220;so special&#8221; and will not work properly if it runs on a virtual machine.  In general, the concerns are:</p>
<ul>
<li>Vendor Support</li>
<li>Performance</li>
</ul>
<p>To be frank, when possible, I don&#8217;t tell users if the machine is virtual or physical.  I&#8217;m not hiding this, but I don&#8217;t volunteer non-relevant information.  Part of planning an application has to do<span id="more-726"></span> with the sizing of the production environment. You read the system requirements and prepare the infrastructure accordingly. The application requirements usually state memory, cpu and OS requirements. They don&#8217;t state that you must run the system on a Dell PowerEdge 2950 with dual Intel(R) XEON(R) E5420 @ 2.5 GHz quadcore cpus using &#8220;blue&#8221; network cables. Part of planning the application is taking the vendor&#8217;s information and adjusting it to account for your own infrastructure. Many companies run standard infrastructure such as: SNMP, VIRUS/MalWare protection and Systems Management software on all of their systems. They must account for this in terms of cpu and memory when sizing for a new application. Virtualization is &#8220;just&#8221; one more variable in the planning and sizing equation. Therefore informing the user that the machine is virtual is simply non-relevant.</p>
<ul><em>I&#8217;ve been told that at <a href="http://www.cisco.com" onclick="pageTracker._trackPageview('/outgoing/www.cisco.com?referer=');">Cisco</a> all new systems are virtual and you must convince John Chambers, the current CEO, to allow you to use a physical machine.</em></ul>
<p><strong><em>Vendor Support</em></strong><br />
Many vendors have confusing support policies regarding virtual machines. I know of one vendor that does all of their development, testing and qa on virtual machines and then does not support running production on virtual machines. <img src='http://bable.cybermarshall.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /> </p>
<p>In my mind, vendor support is an academic issue. I don&#8217;t volunteer the physical machine information to a vendor, so why would I volunteer hardware info about a virtual machine. If a vendor presses the issue, I can always reproduce the issue on a physical machine. <em>To Date: I have never had to reproduce the issue on physical hardware.</em></p>
<p>Keep in mind that all major software vendors plan to support &#8220;Cloud Computing&#8221;. You can&#8217;t seriously support &#8220;Cloud Computing&#8221; without supporting virtualization.  So if your vendor does not support virtual machines, they will begin to shortly or they will face technical obsolescence.</p>
<p><strong><em>Performance</em></strong><br />
To be honest when it comes to performance, virtualization is your friend. That may come as a shock to you, so I&#8217;d better explain.</p>
<p>As I mentioned earlier, part of planning an application is sizing it for production. The sizing takes into account factors such as: memory, # of cpus, minimum recommended cpu speed, the number of concurrent users, the overhead of your common infrastructure and a &#8220;judgment factor&#8221;.  The &#8220;judgment factor&#8221; attempts to account for business growth, typical usage patterns and historical vendor understatement of the hardware requirements <img src='http://bable.cybermarshall.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Over the years, I&#8217;ve seen many projects purchase way too much hardware. I&#8217;ve also seen projects that were struggling to run on the initial hardware within a year or two of the initial roll-out. This can be caused by a variety of reasons, including unexpected business growth or transaction volume due to a temporary business opportunity. Assuming that there are no application locking issues and that cpu or memory is holding the application back, then you are considering how to relocate the application to newer and more powerful hardware. When this happens physical machines become a &#8220;boat anchor&#8221; where virtual machines are a &#8220;lifeboat&#8221;.</p>
<ul>
<li><em>Why Physical machines become a &#8220;boat anchor&#8221;</em>.<br />
It is often difficult and sometimes impossible to move an existing application to new hardware. In the best case scenario, you have to procure new hardware, install and configure the operating system,OS, &#8220;clone&#8221; the application to the new hardware, test the application to ensure the configuration is working correctly and then plan an outage to relocate the application permanently to the new hardware. This is at best a several week project. There can be some show stoppers. You may not be able to relocate the current version of the application, if you must use a later version of an operating system. This can often be the case with new hardware in order to obtain the necessary drivers. Now, you are potentially having to update your entire software stack as well as the application to run on a later version of the OS. You will probably have to retrain users on the new version of the application.<br />
<em>What a nightmare!</em><br />
By the time you are done, you may have missed any temporary business opportunity or the business growth may have been impeded.</li>
<li><em>Why virtual machines are a &#8220;lifeboat&#8221;</em>.<br />
When you outgrow the virtual machine, you can allocate or dedicate more hardware to the virtual machine. If new hardware is required, then you simply migrate the virtual machine to the new hardware, intact. Often this migration can be performed live. Yes, it can be that simple. If you can&#8217;t perform a live migration, then an outage to copy the virtual machine from the old system to the new system will be required.<br />
<em>With virtual machines, you really can throw hardware a some performance problems.</em></li>
</ul>
<p>There are cases where you still need to use physical machines, but these are uncommon. In my opinion, you should always use virtual machines first and then determine that you really need dedicated physical machine.</p>
<p>If after all of this, your user still insists on having a physical machine, then are they also insisting that all programs be written in assembly language? <img src='http://bable.cybermarshall.com/wp-includes/images/smilies/icon_eek.gif' alt='8-O' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/07/02/why-virtual-machines-should-be-the-1st-choice-to-run-your-systems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Application software and license procurement can become the &#8220;long-pole-in-tent&#8221; in production deployments with server virtualization using VMWare, XEN or HYPER-V</title>
		<link>http://bable.cybermarshall.com/2009/01/07/application-software-and-license-procurement-can-become-the-long-pole-in-tent-in-production-deployments-with-server-virtualization-using-vmware-xen-or-hyper-v/</link>
		<comments>http://bable.cybermarshall.com/2009/01/07/application-software-and-license-procurement-can-become-the-long-pole-in-tent-in-production-deployments-with-server-virtualization-using-vmware-xen-or-hyper-v/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 23:49:37 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=232</guid>
		<description><![CDATA[At my company we&#8217;ve been using server virtualization with VMWare products for 2-3 years. During that time we&#8217;ve created processes and procedures that allow us to deploy a server and its supporting operating system in as little as a few minutes. My reading suggests it is the same with the Hyper-V and XEN virtualization products as well.
Unfortunately, obtaining software [...]]]></description>
			<content:encoded><![CDATA[<p>At my company we&#8217;ve been using server virtualization with VMWare products for 2-3 years. During that time we&#8217;ve created processes and procedures that allow us to deploy a server and its supporting operating system in as little as a few minutes. My reading suggests it is the same with the Hyper-V and XEN virtualization products as well.</p>
<p>Unfortunately, obtaining software licenses for the applications that we run on these servers can and does still take many weeks.  The procurement process remains basically unchanged.</p>
<p>Although we&#8217;ve been taking this into account and It may be obvious to many others, you&#8217;ll want to be sure that you take the software and license procurement time into account when establishing project plans.</p>
<p>As an aside, we have one &#8220;well-known&#8221; vendor that keeps sending us 90-day temporary licenses for a product that is paid for and the check has cleared the bank.</p>
<p><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2009/01/07/application-software-and-license-procurement-can-become-the-long-pole-in-tent-in-production-deployments-with-server-virtualization-using-vmware-xen-or-hyper-v/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking VMWare ESX 3.x or ESXi Host resources with Cacti</title>
		<link>http://bable.cybermarshall.com/2008/12/14/tracking-vmware-esx-3x-or-esxi-host-resources-with-cacti/</link>
		<comments>http://bable.cybermarshall.com/2008/12/14/tracking-vmware-esx-3x-or-esxi-host-resources-with-cacti/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 04:22:28 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[cacti]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[esxtop]]></category>
		<category><![CDATA[resxtop]]></category>
		<category><![CDATA[rrdtool]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[vmware esx]]></category>

		<guid isPermaLink="false">http://bable.cybermarshall.com/?p=71</guid>
		<description><![CDATA[I&#8217;ve been using Cacti,  RRDTool, SNMP and custom scripts running on Linux for several years to collect and display historical data regarding Network, System, and FlexLM license resource usage. I recently began tracking the Host resources used by ESX.  I was interested in tracking the following:

CPU utilization
Memory Free
Total Memory
IO activity
Network traffic


I found that the IO [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Cacti,  RRDTool, SNMP and custom scripts running on Linux for several years to collect and display historical data regarding Network, System, and FlexLM license resource usage. I recently began tracking the Host resources used by ESX.  I was interested in tracking the following:</p>
<ul>
<li>CPU utilization</li>
<li>Memory Free</li>
<li>Total Memory</li>
<li>IO activity</li>
<li>Network traffic</li>
</ul>
<p><span id="more-71"></span></p>
<p>I found that the IO activity and Network traffic could be obtained via standard SNMP. The network traffic can be obtained by summing the results from an snmpwalk of VMWARE-RESOURCES-MIB::netHCKbRx and VMWARE-RESOURCES-MIB::netHCKbTx.  Similarly, the IO can be obtained by summing the results from an snmpwalk of VMWARE-RESOURCES-MIB::kbRead and VMWARE-RESOURCES-MIB::kbWritten.</p>
<p style="text-align: left;">I did not identify items in the vmware esx mib that I could use via SNMP for the CPU utilization or Free Memory. I did find that these items are available by running esxtop or resxtop in batch mode. Running the utility esxtop on the ESX service console in batch outputs a comma separated file, csv. For example: running the command <em></em></p>
<ul><em>esxtop -b -n 2 -d 10 &gt; esxtop-output.csv</em></ul>
<p style="text-align: left;">will run esxtop in batch, take 2 samples with a delay of 10 seconds and write a 3 row csv file named &#8220;esxtop-output.csv&#8221;. The 1<sup>st</sup> line of the .csv file contains the column headers. The ESX Host cpu utilization time will be in a column named:</p>
<p style="margin-left: 40px; text-align: left;">&#8220;\\[your-esx-hostname]\Physical Cpu(_Total)\% Processor Time&#8221;</p>
<p style="text-align: left;">The ESX Host free memory will be in a column named:</p>
<p style="margin-left: 40px; text-align: left;">&#8220;\\[your-esx-hostname]\Memory\Free MBytes&#8221;.</p>
<p style="text-align: left;">The ESX Host total memory will be in a column named:</p>
<p style="margin-left: 40px; text-align: left;">&#8220;\\[your-esx-hostname]\Memory\Machine MBytes&#8221;.</p>
<p style="text-align: left;">Today, I run 2 cronjobs; 1 on my ESX service console to run esxtop in batch and save the data to a .csv file; and the 2<sup>nd</sup> on my Cacti monitoring server.  On the Cacti monitoring server, I run a &#8220;driver&#8221; <a href="#get_update_esx_stats">script</a> to collect data items into an RRDTool database every 5 minutes. My Cacti monitoring server uses identity based ssh/scp to get the .csv file that is produced by the cronjob that runs on the ESX service console.The RRD database is mapped as a datasource and graphed via Cacti.  I&#8217;m currently looking at using the VMWare remote cli version of esxtop, rexstop. The use of resxtop, would eliminate the need for a cronjob on the ESX service console. This will allow my utilities to run against both ESX and ESXi.</p>
<hr />
<p style="text-align: left;">Scripts</p>
<hr /><a id="get_update_esx_stats" name="get_update_esx_stats"></a></p>
<p>ESX RRDTool Data update Script. Call with Arguments DBName, Hostname and community, this driver ccript calls this script to obtain the <a href="#get_esx_perf">individual items</a></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code5'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p715"><td class="code" id="p71code5"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
. <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>setrrdtool_vars
<span style="color: #007800;">PERF_BASE</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>perfmon-esx
<span style="color: #007800;">PATH</span>=<span style="color: #800000;">${PERF_BASE}</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #800000;">${PATH}</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># arg 1 - DBNAME</span>
<span style="color: #666666; font-style: italic;"># arg 2 - monitor host</span>
<span style="color: #666666; font-style: italic;"># arg 3 - community</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;must supply rrd dbname&quot;</span>
   <span style="color: #007800;">call_errror</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${2}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;must supply host&quot;</span>
   <span style="color: #007800;">call_errror</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${3}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;must supply community&quot;</span>
   <span style="color: #007800;">call_errror</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${call_error}</span>&quot;</span> = <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">DBNAME</span>=<span style="color: #800000;">${1}</span>
<span style="color: #007800;">MHOST</span>=<span style="color: #800000;">${2}</span>
<span style="color: #007800;">COMMUNITY</span>=<span style="color: #800000;">${3}</span>
&nbsp;
<span style="color: #007800;">RRD_DB</span>=<span style="color: #800000;">${PERF_BASE}</span><span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${DBNAME}</span>
<span style="color: #007800;">RRD_LOG</span>=<span style="color: #800000;">${PERF_BASE}</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${DBNAME}</span>.log
&nbsp;
<span style="color: #007800;">TOD</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> tline <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${T}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #007800;">itemname</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${tline}</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">itemval</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${tline}</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${itemname}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
	<span style="color: #ff0000;">&quot;total_cpu&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
	   <span style="color: #007800;">CPU</span>=<span style="color: #800000;">${itemval}</span>
	   <span style="color: #000000; font-weight: bold;">;;</span>
      <span style="color: #ff0000;">&quot;available_memory&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #007800;">MEMAVAIL</span>=<span style="color: #800000;">${itemval}</span>
         <span style="color: #000000; font-weight: bold;">;;</span>
      <span style="color: #ff0000;">&quot;total_memory&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #007800;">TOTMEM</span>=<span style="color: #800000;">${itemval}</span>
         <span style="color: #000000; font-weight: bold;">;;</span>
      <span style="color: #ff0000;">&quot;iokb_total&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #007800;">IOKB</span>=<span style="color: #800000;">${itemval}</span>
         <span style="color: #000000; font-weight: bold;">;;</span>
       <span style="color: #ff0000;">&quot;netkb_total&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
         <span style="color: #007800;">NETKB</span>=<span style="color: #800000;">${itemval}</span>
         <span style="color: #000000; font-weight: bold;">;;</span>
	<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
	  <span style="color: #000000; font-weight: bold;">;;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
rrdtool update <span style="color: #800000;">${RRD_DB}</span> <span style="color: #660033;">--template</span> \
CPU_utilization:Memory_available:IO_KBytes:Net_KBytes \
N:<span style="color: #800000;">${CPU}</span>:<span style="color: #800000;">${MEMAVAIL}</span>:<span style="color: #800000;">${IOKB}</span>:<span style="color: #800000;">${NETKB}</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p><a id="get_esx_perf" name="get_esx_perf"></a></p>
<p>ESX Data capture Script. Call with Arguments Hostname and community. This uses SSH/SCP, SNMP and some <a href="#get_stats">additional helper scripts to parse </a>the csv data returned by esxtop</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p716"><td class="code" id="p71code6"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
. <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>setrrdtool_vars
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MIBS</span>=ALL
<span style="color: #666666; font-style: italic;"># arg 1 - monitor host</span>
<span style="color: #666666; font-style: italic;"># arg 2 - community</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;must supply host to monitor&quot;</span>
   <span style="color: #007800;">call_errror</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
   <span style="color: #007800;">MHOST</span>=<span style="color: #800000;">${1}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${2}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;must supply community&quot;</span>
   <span style="color: #007800;">call_errror</span>=<span style="color: #ff0000;">&quot;yes&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
   <span style="color: #007800;">COMMUNITY</span>=<span style="color: #800000;">${2}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${call_error}</span>&quot;</span> = <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">exit</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">PERFDIR</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>perfmon-esx
<span style="color: #007800;">PATH</span>=<span style="color: #800000;">${PATH}</span>:<span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats
<span style="color: #007800;">WORKDIR</span>=<span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #007800;">ESXTOPCSV</span>=mrtg-esxtop.csv
<span style="color: #007800;">CSVfile</span>=<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-<span style="color: #800000;">${ESXTOPCSV}</span>
<span style="color: #7a0874; font-weight: bold;">export</span> PATH
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #800000;">${WORKDIR}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #800000;">${WORKDIR}</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># use identity based ssh to copy latest csv file from ${MHOST}</span>
<span style="color: #666666; font-style: italic;"># could replace with resxtop and output output to ${CSVfile}</span>
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-Bq</span> <span style="color: #800000;">${MHOST}</span>:<span style="color: #800000;">${ESXTOPCSV}</span> <span style="color: #800000;">${CSVfile}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin CPU</span>
get_cpustats <span style="color: #800000;">${CSVfile}</span> <span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-cpustat.tmp
<span style="color: #007800;">CPUTOT</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-cpustat.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #800000;">${MHOST}</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">linenum</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${CPUTOT}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${linenum}</span>&quot;</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
     <span style="color: #007800;">cpupct_total</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${line}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #666666; font-style: italic;">#End CPU</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Host Available Memory</span>
get_machine_mem <span style="color: #800000;">${CSVfile}</span> <span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-machinemem.tmp
<span style="color: #007800;">MACHINEMEM</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-machinemem.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #800000;">${MHOST}</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">linenum</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${MACHINEMEM}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${linenum}</span>&quot;</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
     <span style="color: #007800;">tMachineMem</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${line}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #666666; font-style: italic;"># Adjust answer to bytes</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;MachineMem = tMachineMem * 1024&quot;</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;TotalMem = MachineMem&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin Used Memory</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Kernel Used Memory</span>
<span style="color: #007800;">linecnt</span>=<span style="color: #000000;">0</span>
get_kern_used_mem <span style="color: #800000;">${CSVfile}</span> <span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-kernused.tmp
<span style="color: #007800;">KERNMEM</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-kernused.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #800000;">${MHOST}</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">linenum</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${KERNMEM}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${linenum}</span>&quot;</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
     <span style="color: #007800;">tKernMem</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${line}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #666666; font-style: italic;"># Adjust answer to bytes</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;KernMem = tKernMem * 1024&quot;</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Non-Kernel Used Memory</span>
get_nonkern_used_mem <span style="color: #800000;">${CSVfile}</span> <span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-nonkernused.tmp
<span style="color: #007800;">NONKERNMEM</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-nonkernused.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #800000;">${MHOST}</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">linenum</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${NONKERNMEM}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${linenum}</span>&quot;</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
     <span style="color: #007800;">tNonKernMem</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${line}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #666666; font-style: italic;"># Adjust answer to bytes</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;NonKernMem = tNonKernMem * 1024&quot;</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># End Used Memory</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Begin Free Memory</span>
get_free_mem <span style="color: #800000;">${CSVfile}</span> <span style="color: #800000;">${PERFDIR}</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>esxstats <span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-freemem.tmp
<span style="color: #007800;">FREET</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${WORKDIR}</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #800000;">${MHOST}</span>-freemem.tmp <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #800000;">${MHOST}</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">linenum</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">for</span> line <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${FREET}</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${linenum}</span>&quot;</span> = <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
     <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
     <span style="color: #007800;">tAvailMem</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${line}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">'&quot;'</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #666666; font-style: italic;"># Adjust answer to bytes</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;AvailMem = tAvailMem * 1024&quot;</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;linenum = linenum + 1&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #666666; font-style: italic;"># End Free Memory</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#IO </span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Get IO READ Write each VM</span>
<span style="color: #007800;">ALLREAD</span>=<span style="color: #000000; font-weight: bold;">`</span>snmpwalk <span style="color: #660033;">-m</span> ALL <span style="color: #660033;">-c</span> <span style="color: #800000;">${COMMUNITY}</span> <span style="color: #660033;">-v</span> 2c <span style="color: #800000;">${MHOST}</span> VMWARE-RESOURCES-MIB::kbRead <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">ALLWRITE</span>=<span style="color: #000000; font-weight: bold;">`</span>snmpwalk <span style="color: #660033;">-m</span> ALL <span style="color: #660033;">-c</span> <span style="color: #800000;">${COMMUNITY}</span> <span style="color: #660033;">-v</span> 2c <span style="color: #800000;">${MHOST}</span> VMWARE-RESOURCES-MIB::kbWritten<span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">IORead</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">for</span> iobr <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${ALLREAD}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${iobr}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${iobr}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">else</span>
       <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;IORead = IORead + iobr&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #007800;">IOWritten</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">for</span> iobw <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${ALLWRITE}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${iobw}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${iobw}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">else</span>
       <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;IOWritten = IOWitten + iobw&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;IOTotal=IORead + IOWritten&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Get NetworkBytesTotalPerSec from each interface and calculate the total</span>
<span style="color: #007800;">ALLNET_RX</span>=<span style="color: #000000; font-weight: bold;">`</span>snmpwalk <span style="color: #660033;">-m</span> ALL <span style="color: #660033;">-c</span> <span style="color: #800000;">${COMMUNITY}</span> <span style="color: #660033;">-v</span> 2c <span style="color: #800000;">${MHOST}</span> VMWARE-RESOURCES-MIB::netHCKbRx <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">ALLNET_TX</span>=<span style="color: #000000; font-weight: bold;">`</span>snmpwalk <span style="color: #660033;">-m</span> ALL <span style="color: #660033;">-c</span> <span style="color: #800000;">${COMMUNITY}</span> <span style="color: #660033;">-v</span> 2c <span style="color: #800000;">${MHOST}</span> VMWARE-RESOURCES-MIB::netHCKbTx <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;:&quot;</span> <span style="color: #ff0000;">'{print $4}'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">NetRX</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">for</span> netr <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${ALLNET_RX}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${netr}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${netr}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">else</span>
       <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;NetRX = NetRX + netr&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #007800;">NetTX</span>=<span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">for</span> nett <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${ALLNET_TX}</span>; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${nett}</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${nett}</span>&quot;</span> = <span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">skipping</span>=<span style="color: #000000;">1</span>
    <span style="color: #000000; font-weight: bold;">else</span>
       <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;NetTX = NetTX + nett&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #ff0000;">&quot;NetTotal=NetRX + NetTX&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> total_cpu:<span style="color: #800000;">${cpupct_total}</span> total_memory:<span style="color: #800000;">${TotalMem}</span> available_memory:<span style="color: #800000;">${AvailMem}</span> iokb_total:<span style="color: #800000;">${IOTotal}</span> netkb_total:<span style="color: #800000;">${NetTotal}</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p><a id="get_stats" name="get_stats"></a></p>
<p>ESX Data parse script(s). Call each one with the esxtop csv file to grab the data. Uses this <a href="#get_index_awk">awk script</a></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p717"><td class="code" id="p71code7"><pre class="bash" style="font-family:monospace;">each script is a seperate <span style="color: #c20cb9; font-weight: bold;">file</span>
<span style="color: #666666; font-style: italic;"># get_cpustats</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;Physical Cpu(_Total)&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get_free_mem</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;Free MBytes&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># get_machine_mem</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;Machine MBytes&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#get_kern_used_mem</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;Kernel MBytes&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#get_managed_mem</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;Kernel Managed MBytes&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#get_nonkern_used_mem</span>
<span style="color: #007800;">CSVfile</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">NDX</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">str</span>=<span style="color: #ff0000;">&quot;NonKernel MBytes&quot;</span> <span style="color: #660033;">-f</span> <span style="color: #800000;">${2}</span><span style="color: #000000; font-weight: bold;">/</span>get_index_awk<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${CSVfile}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #660033;">-v</span> <span style="color: #007800;">i</span>=<span style="color: #007800;">$NDX</span> <span style="color: #660033;">-F</span><span style="color: #ff0000;">&quot;,&quot;</span> <span style="color: #ff0000;">'{print $i}'</span></pre></td></tr></table></div>

<p><a id="get_index_awk" name="get_index_awk"></a></p>
<p>awk script used by get_cpustats, etc</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p71code8'); return false;">View Code</a> NONE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p718"><td class="code" id="p71code8"><pre class="none" style="font-family:monospace;">BEGIN {FS=&quot;,&quot;}
      {colndx=0;
       for (i=1; i&amp;lt;=NF; i++) {
           if (index($i,str) &amp;gt;0 ) {
               colndx=i;
               print colndx;
               i=NF;
               break;
               }
           }
      }</pre></td></tr></table></div>

<p style="text-align: left;"><center><script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
google_ad_slot = "5649858591";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2008/12/14/tracking-vmware-esx-3x-or-esxi-host-resources-with-cacti/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Slow Clock in guest OS on VMWare Server 1.x</title>
		<link>http://bable.cybermarshall.com/2008/11/12/slow-clock-in-guest-os-on-vmware-server-1x/</link>
		<comments>http://bable.cybermarshall.com/2008/11/12/slow-clock-in-guest-os-on-vmware-server-1x/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 23:23:33 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[virtualization]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[clock]]></category>
		<category><![CDATA[vmware server]]></category>

		<guid isPermaLink="false">http://www.cybermarshall.com/blogs/david/?p=5</guid>
		<description><![CDATA[When using VMware Server 1.x, I&#8217;ve encountered a few guest Virtual Machines, VMs, where the clocks do not advance correctly. What is especially frustrating about this is that frequently the clocks in the other guest VM&#8217;s on the same host are operating correctly. I&#8217;ve not yet determined what causes the inconsistency across the guest VM&#8217;s, [...]]]></description>
			<content:encoded><![CDATA[<p>When using VMware Server 1.x, I&#8217;ve encountered a few guest Virtual Machines, VMs, where the clocks do not advance correctly. What is especially frustrating about this is that frequently the clocks in the other guest VM&#8217;s on the same host are operating correctly. I&#8217;ve not yet determined what causes the inconsistency across the guest VM&#8217;s, but overtime, I&#8217;ve found a few tricks to work-around this issue.</p>
<p><span id="more-5"></span></p>
<p><code><br />
</code></p>
<p>Trick #1 &#8212; Host OS power management may be causing the host to update the clock incorrectly, tell the VMware server software the real clock speed of the cpus by modifying the config.ini.</p>
<p>Add the following entries and restart the vmware authorization server</p>
<ul>
<li>host.cpukHz = &#8220;30000000&#8243; (this example is for a 3 GHZ system)</li>
<li>host.noTSC = &#8220;TRUE&#8221;</li>
<li>ptsc.noTSC = &#8220;TRUE&#8221;</li>
</ul>
<p>On windows the default location of the VMware config.ini is C:\Documents and Settings\All Users\Application Data\VMware\VMware Server</p>
<p>On Linux this file is in /etc/vmware/config</p>
<p>Trick #2 &#8212; set the VMware Tools Clock Synchronization to update more frequently by editing the .vmx file and adding</p>
<ul>
<li>tools.syncTime = “TRUE”</li>
<li>tools.syncTime.period = “1″ (this is for a 1 second update)</li>
<li>timeTracker.periodicStats=”True”</li>
<li>timeTracker.statsIntercal=”10″</li>
</ul>
<p>A word of caution, If you use Trick #2 and later you attempt to convert the VMWare Server VM to ESX , then you may have to comment out or remove these items</p>
<ul>
<li>tools.syncTime.period</li>
<li>timeTracker.periodicStats</li>
<li>timeTracker.statsIntercal</li>
</ul>
<p>from the .vmx file. At least one version of VMWare converter did not create a VM that I could use in ESX, until I had removed those items prior to running the converter.</p>
<p><center>
<script type="text/javascript"><!--
google_ad_client = "pub-5633552336244805";
/* 125x125, created 10/24/08 */
google_ad_slot = "7137128911";
google_ad_width = 125;
google_ad_height = 125;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://bable.cybermarshall.com/2008/11/12/slow-clock-in-guest-os-on-vmware-server-1x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
