Xymon Mailing List Archive search

VMWare ESX

list Shifter
Fri, 26 Jan 2007 12:37:38 -0800
Message-Id: <user-a4aae5eb0d64@xymon.invalid>

Note: this is regarding ESX 3.x

I was running into a similar issue with trying to get the usage data from
the ESX host.  The problem I was seeing though was that a system I *knew* to
be extremely heavily utilized as evidenced by MUI/VC usage data, was
reporting back only ~5% utilization.  The problem was that the console OS is
almost like a VM itself and the tools were only showing usage data as used
by the console OS.

Here's how I was able to get around it, with mad props to those who have
helped me in the past to get the custom graphing working:
On hobbit client:

   - Ensure hobbit client is already installed first.
   - visudo (or vi /etc/sudoers) (needs root access to run esxtop)
   - hobbit ALL = NOPASSWD: /usr/bin/esxtop
   - service firewall stop, chkconfig firewall off (for my environment a
   FW was not necessary, YMMV)
   - su hobbit
   - In /apps/hobbit/client/ext/pcpu paste the script below, then chmod
   +x


#!/bin/sh
# Dynamically detects the number of CPU's on the machine and grabs the
data from the appropriate field.

tmp=`cat /proc/vmware/cpuinfo | grep pcpu | wc -w | sed 's/^[
\t]*//;s/[ \t]*$//'`
tmp=`expr $tmp - 1`
cpuCount=`expr $tmp / 2`
targetField=`expr 8 + $cpuCount`
targetField="\$$targetField"

strPre="sudo esxtop -bn 2 | awk 'BEGIN {FS=\",\"};"
strTemp="{print \"pcpuIdle : \"(100-(substr($targetField, 2,
length($targetField)-2)))}'"
strPost=" | tail -1 | sed 's/\\\"//g' > /tmp/pcpu.txt"

strCommand="$strPre $strTemp $strPost"

eval "$strCommand"

$BB $BBDISP "data $MACHINE.pcpuIdle
`cat /tmp/pcpu.txt`
"
exit 0


   - In /apps/hobbit/client/etc/clientlaunch.cfg


[pcpu]
        ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
        CMD $HOBBITCLIENTHOME/ext/pcpu
        INTERVAL 5m


   - Restart client


On hobbit host:

   - In hobbitgraph.cfg:


[pcpuIdle]
        TITLE ESX CPU Utilitization
        YAXIS % Used
        -u 100
        -r
        DEF:cpu_idle=pcpuIdle.rrd:pcpuIdle:AVERAGE
        CDEF:pbusy=100,cpu_idle,-
        AREA:pbusy#FF0000:Busy
        GPRINT:pbusy:LAST: \: %5.1lf (cur)
        GPRINT:pbusy:MAX: \: %5.1lf (max)
        GPRINT:pbusy:MIN: \: %5.1lf (min)
        GPRINT:pbusy:AVERAGE: \: %5.1lf (avg)\n
        STACK:cpu_idle#00FF00:Idle
        GPRINT:cpu_idle:LAST: \: %5.1lf (cur)
        GPRINT:cpu_idle:MAX: \: %5.1lf (max)
        GPRINT:cpu_idle:MIN: \: %5.1lf (min)
        GPRINT:cpu_idle:AVERAGE: \: %5.1lf (avg)\n


   - In hobbitserver.cfg:


TEST2RRD="cpu=la,disk,inode,qtree,memory,$PINGCOLUMN=tcp,http=tcp,dns=tcp,dig=tcp,time=ntpstat,vmstat,iostat,netstat,temperature,apache,bind,sendmail,mailq,nmailq=mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,files,procs=processes,ports,clock,lines,pcpuIdle=ncv"

GRAPHS="la,disk,inode,qtree,files,processes,memory,users,vmstat,iostat,tcp.http,tcp,ncv,netstat,ifstat,mrtg::1,ports,temperature,ntpstat,apache,bind,sendmail,mailq,socks,bea,iishealth,citrix,bbgen,bbtest,bbproxy,hobbitd,clock,lines,pcpuIdle"

NCV_pcpuIdle="pcpuIdle:GAUGE"


Hope that helps.

On 1/26/07, Rich Smrcina <user-cf452ff334e0@xymon.invalid> wrote:
VMware ESX provides SNMP support, so it is likely that devmon can be
used to query the data and report it to Hobbit.  I dabbled with some
shell scripts to capture the info, but didn't get too far... :(

Jon Dustin wrote:
Greetings -

I have been using Hobbit since summer 2006 (and Big Brother for about
10 years prior). GREAT system, my appreciation to Henrik and the
community.

I am evaluating how to monitor our VMWare ESX boxes with Hobbit. I
would like to have ESX report the "standard" set of data (cpu, disk,
memory, msgs, procs, trends) and have Hobbit graph the data
appropriately. As some of you may know, ESX is its "own" OS, with
slightly different management tools for reporting on the VM GUEST
sessions. There are appropriate analogies for top, ps, df, etc.

It seems this might best be handled by sending a "client data" report
to Hobbit, and masquerading ESX to "look" similar to a Linux box.

Is this feasible? Any potential problems? I have looked for some
documentation on the client report, to no avail. Or should I just look
at the Hobbit CLIENT source?

Thanks for any tips/tricks/traps.

--
Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid

Catch the WAVV!  http://www.wavv.org
WAVV 2007 - Green Bay, WI - May 18-22, 2007