[hobbit] VMWare ESX

Shifter the.shifter at gmail.com
Fri Jan 26 21:37:38 CET 2007


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 <rsmrcina at wi.rr.com> 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.
> >
> >
> >
> > To unsubscribe from the hobbit list, send an e-mail to
> > hobbit-unsubscribe at hswn.dk
> >
> >
>
> --
> Rich Smrcina
> VM Assist, Inc.
> Phone: 414-491-6001
> Ans Service:  360-715-2467
> rich.smrcina at vmassist.com
>
> Catch the WAVV!  http://www.wavv.org
> WAVV 2007 - Green Bay, WI - May 18-22, 2007
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20070126/4bb58d25/attachment.html>


More information about the Xymon mailing list