Xymon Mailing List Archive search

Monitoring and ESX host

15 messages in this thread

list Aaron Stranberg · Mon, 2 Jul 2007 16:03:26 +0000 ·
Hello all,      I am searching for folks that are successfully monitoring aVMware ESX3 host with either the hobbit client or BB client?  I am inthe unfortunate situation of not having a test environment to test withand would appreciate getting a head start on others exeprience.  Anyspecific RPM for hobbit that is known to work on the ESX3 host, detailson dependency packages that were required would be most welcome.Thanks-Aaron
With Windows Live Hotmail, you can personalize your inbox with your favorite color.
www.windowslive-hotmail.com/learnmore/personalize.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_addcolor_0607
list Allen Jasewicz · Mon, 2 Jul 2007 12:47:57 -0400 ·
I would be willing to assist.  But first I need to get Hobbit working.
I am going through the mailing list to try and figure out why none of
the buttons work.  I compiled my fist copy of Hobbit last week I keep
getting "Internal server error" on any link within hobbit
quoted from Aaron Stranberg

 
From: Aaron Stranberg [mailto:user-41792dc73029@xymon.invalid] 
Sent: Monday, July 02, 2007 12:03 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Monitoring and ESX host

 
Hello all,
      I am searching for folks that are successfully monitoring aVMware
ESX3 host with either the hobbit client or BB client?  I am inthe
unfortunate situation of not having a test environment to test withand
would appreciate getting a head start on others exeprience.  Anyspecific
RPM for hobbit that is known to work on the ESX3 host, detailson

dependency packages that were required would be most welcome.

Thanks
-Aaron


Change is good. See what's different about Windows Live Hotmail. Check
it out!


Yazaki North America, Inc. - Confidentiality Notice


This email is intended only for the person or entity to which it is
addressed and may contain confidential, proprietary and/or privileged
material. Any review, distribution, reliance on, or other use of this
information by persons or entities other than the intended recipient is
prohibited. If you receive this message in error, please immediately
notify the sender and delete it and all copies of it from your system.
Thank you.
list Rich Smrcina · Mon, 02 Jul 2007 12:08:45 -0500 ·
I've started looking at it from an SNMP perspective.  The problem that I've come across is tying the detail info for virtual machines (CPU Utilization, Network stuff) back to a virtual machine.
quoted from Allen Jasewicz

Allen Jasewicz wrote:
I would be willing to assist.  But first I need to get Hobbit working.  I am going through the mailing list to try and figure out why none of the buttons work.  I compiled my fist copy of Hobbit last week I keep getting “Internal server error” on any link within hobbit

 
*From:* Aaron Stranberg [mailto:user-41792dc73029@xymon.invalid]
*Sent:* Monday, July 02, 2007 12:03 PM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* [hobbit] Monitoring and ESX host

 
Hello all,
      I am searching for folks that are successfully monitoring aVMware ESX3 host with either the hobbit client or BB client?  I am inthe unfortunate situation of not having a test environment to test withand would appreciate getting a head start on others exeprience.  Anyspecific RPM for hobbit that is known to work on the ESX3 host, detailson dependency packages that were required would be most welcome.

Thanks
-Aaron


Change is good. See what's different about Windows Live Hotmail. Check it out! <www.windowslive-hotmail.com/learnmore/default.html?locale=en-us&ocid=RMT_TAGLM_HMWL_reten_changegood_0607>
quoted from Allen Jasewicz


*Yazaki North America, Inc. - Confidentiality Notice*


This email is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, distribution, reliance on, or other use of this information by persons or entities other than the intended recipient is prohibited. If you receive this message in error, please immediately notify the sender and delete it and all copies of it from your system. Thank you.


*Yazaki North America, Inc. - Confidentiality Notice*

This email is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, distribution, reliance on, or other use of this information by persons or entities other than the intended recipient is prohibited. If you receive this message in error, please immediately notify the sender and delete it and all copies of it from your system. Thank you.
-- 

Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid
http://www.linkedin.com/in/richsmrcina

Catch the WAVV!  http://www.wavv.org
WAVV 2008 - Chattanooga - April 18-22, 2008
list David Stuffle · Mon, 2 Jul 2007 13:40:23 -0400 ·
quoted from Rich Smrcina
I would be willing to assist.  But first I need to get Hobbit working.
I am going through the mailing list to try and figure out why none of
the buttons work.  > I compiled my fist copy of Hobbit last week I keep
getting "Internal server error" on any link within hobbit

 

I just went through the same issue.  Check your linux security settings.
Do a `getenforce` command and see if it's says "enforcing" which means
SElinux is enabled.  If it does, put selinux=0 at the end of the kernel
line in your grub.conf.  Then reboot.

 
D. Stuffle

DISCLAIMER:
The information transmitted is intended only for the person or entity to 
which it is addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received this in error,
please contact the sender and destroy any copies of this document and
any attachments.
list Allen Jasewicz · Mon, 2 Jul 2007 13:55:10 -0400 ·
I am on Solaris 9, and still digging
quoted from David Stuffle

 
From: Stuffle, David (Corporate) [mailto:user-b750360cbb5f@xymon.invalid] 
Sent: Monday, July 02, 2007 1:40 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] Monitoring and ESX host

 
I would be willing to assist.  But first I need to get Hobbit working.
I am going through the mailing list to try and figure out why none of
the buttons work.  > I compiled my fist copy of Hobbit last week I keep
getting "Internal server error" on any link within hobbit

 
I just went through the same issue.  Check your linux security settings.
Do a `getenforce` command and see if it's says "enforcing" which means
SElinux is enabled.  If it does, put selinux=0 at the end of the kernel
line in your grub.conf.  Then reboot.

 
D. Stuffle

DISCLAIMER:
The information transmitted is intended only for the person or entity to

which it is addressed and may contain confidential and/or privileged
material.
Any review, retransmission, dissemination or other use of, or taking of
any action in reliance upon, this information by persons or entities
other
than the intended recipient is prohibited. If you received this in
error,
please contact the sender and destroy any copies of this document and
any attachments.
list Jon Dustin · Mon, 02 Jul 2007 14:19:15 -0400 ·
On 7/2/2007 at 12:03 PM, Aaron Stranberg <user-41792dc73029@xymon.invalid>
quoted from Rich Smrcina
wrote:
Hello all,      I am searching for folks that are successfully
monitoring 
aVMware ESX3 host with either the hobbit client or BB client?  I am
inthe 
unfortunate situation of not having a test environment to test
withand would 
appreciate getting a head start on others exeprience.  Anyspecific
RPM for 
hobbit that is known to work on the ESX3 host, detailson dependency
packages 
that were required would be most welcome.Thanks-Aaron
Here is a snippet of the code I run on ESX3:

my $esxtop = "sudo /usr/bin/esxtop -b -d $interval";
open(CMD,"$esxtop |") || die "error - could not open $esxtop   $!\n";
my $count = 0;
while( <CMD> ) {
        chomp;
        s/\"//g;
        my (@row) = split/\,/;
        $count++;
        if ( $count <= 2 ) { next; }    # skip 1st few results, just
titles and 100% values
        my $util = int($row[9]);        # round to INT, because RRD
does not like floating-point
        &SendHobbit($util);
}

This is a PERL script, called by the "standard" Hobbit client running
inside the service console. The only ESX-specific parameter I am
watching is overall CPU utilization. The subroutine SendHobbit "prints"
the data to tcp/1984 with the following line:

print SOCK "status $MACHINE.pcpu $COLOR $datenow\npcpuBusy : $util\n";

I was able to compile the Hobbit client on a RedHat box, then ZIP the
client and manually install on ESX. 

Good luck!
-- 

--
Jon Dustin - Network Specialist
University of Southern Maine
Portland, ME
list Henrik Størner · Mon, 2 Jul 2007 23:11:23 +0200 ·
On Mon, Jul 02, 2007 at 01:55:10PM -0400, Allen Jasewicz wrote:
I am on Solaris 9, and still digging
Most of those who have problems on Solaris is because the shared
libraries used by Hobbit are in /usr/local/lib, which is not searched
by default by the dynamic linker.

Try adding

   LD_LIBRARY_PATH=/usr/local/lib
   export LD_LIBRARY_PATH

at the top of your hobbitcgi.cfg file, or use the "crle" utility to
include /usr/local/lib in your system's default library path.


Regards,
Henrik
list Jason Altrincham Jones · Tue, 3 Jul 2007 10:26:10 +0100 ·
When I did this I compiled the hobbit client on the esx box then edited
hobbitclient-linux.sh ($BBCLIENTHOME/bin) and added the line:

	TOP=esxtop

Just above the line:

	"# $TOP must be set, the install utility should do that for us
if it exists."

I am currently looking into a way of getting some output on what virtual
machines are actually running on the esx server and what kind of cpu
levels etc. they are at but that's on hold atm.

Thanks,
Jason.
quoted from Jon Dustin

-----Original Message-----
From: Jon Dustin [mailto:user-d8c63a8259c1@xymon.invalid] 
Sent: 02 July 2007 19:19
To: Aaron Stranberg; user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] Re: Monitoring and ESX host
On 7/2/2007 at 12:03 PM, Aaron Stranberg <user-41792dc73029@xymon.invalid>
wrote:
Hello all,      I am searching for folks that are successfully
monitoring 
aVMware ESX3 host with either the hobbit client or BB client?  I am
inthe 
unfortunate situation of not having a test environment to test
withand would 
appreciate getting a head start on others exeprience.  Anyspecific
RPM for 
hobbit that is known to work on the ESX3 host, detailson dependency
packages 
that were required would be most welcome.Thanks-Aaron
Here is a snippet of the code I run on ESX3:

my $esxtop = "sudo /usr/bin/esxtop -b -d $interval";
open(CMD,"$esxtop |") || die "error - could not open $esxtop   $!\n";
my $count = 0;
while( <CMD> ) {
        chomp;
        s/\"//g;
        my (@row) = split/\,/;
        $count++;
        if ( $count <= 2 ) { next; }    # skip 1st few results, just
titles and 100% values
        my $util = int($row[9]);        # round to INT, because RRD
does not like floating-point
        &SendHobbit($util);
}

This is a PERL script, called by the "standard" Hobbit client running
inside the service console. The only ESX-specific parameter I am
watching is overall CPU utilization. The subroutine SendHobbit "prints"
the data to tcp/1984 with the following line:

print SOCK "status $MACHINE.pcpu $COLOR $datenow\npcpuBusy : $util\n";

I was able to compile the Hobbit client on a RedHat box, then ZIP the
client and manually install on ESX. 

Good luck!
-- 

--
Jon Dustin - Network Specialist
University of Southern Maine
Portland, ME
list Allen Jasewicz · Tue, 3 Jul 2007 08:03:29 -0400 ·
Great,! that's about the only place I did not put the LD_LIBRARY_PATH, I
have the headings no but not the green, read, white, etc .. buttons.  I
still get internal server error
quoted from Henrik Størner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Monday, July 02, 2007 5:11 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Monitoring and ESX host

On Mon, Jul 02, 2007 at 01:55:10PM -0400, Allen Jasewicz wrote:
I am on Solaris 9, and still digging
Most of those who have problems on Solaris is because the shared
libraries used by Hobbit are in /usr/local/lib, which is not searched
by default by the dynamic linker.

Try adding

   LD_LIBRARY_PATH=/usr/local/lib
   export LD_LIBRARY_PATH

at the top of your hobbitcgi.cfg file, or use the "crle" utility to
include /usr/local/lib in your system's default library path.


Regards,
Henrik


Yazaki North America, Inc. - Confidentiality Notice

This email is intended only for the person or entity to which it is addressed and may contain confidential, proprietary and/or privileged material. Any review, distribution, reliance on, or other use of this information by persons or entities other than the intended recipient is prohibited. If you receive this message in error, please immediately notify the sender and delete it and all copies of it from your system. Thank you.
list Dominique Frise · Wed, 04 Jul 2007 09:23:56 +0200 ·
quoted from Aaron Stranberg
Aaron Stranberg wrote:
Hello all,
      I am searching for folks that are successfully monitoring aVMware ESX3 host with either the hobbit client or BB client?  I am inthe unfortunate situation of not having a test environment to test withand would appreciate getting a head start on others exeprience.  Anyspecific RPM for hobbit that is known to work on the ESX3 host, detailson dependency packages that were required would be most welcome.

Thanks
-Aaron
Change is good. See what's different about Windows Live Hotmail. Check it out! <www.windowslive-hotmail.com/learnmore/default.html?locale=en-us&ocid=RMT_TAGLM_HMWL_reten_changegood_0607>
Our ESX3 servers run a client compiled on RHEL3.
The user running Hobbit has to be authorized -sudo- to use "esxtop" and "vdf" utilities.
The sections [uptime], [df] and [top] in hobbitclient-linux.sh are modified like this:

...
...
# VMware ESX3 support
vmnix=`uname -r | grep "vmnix"`
...
...
echo "[uptime]"
if [ $vmnix ]; then
    # "uptime" only reports about the ESX console load.
    # Use "esxtop" to report the total load.
    echo `uptime | cut -d: -f1-4`: `sudo esxtop -n 1 -b | head -2 | tail -1 | awk -F\, '{print $5 " " $6 " " $7}' | awk -F\" '{print $2", "$4", "$6}'`
else
    uptime
fi
echo "[who]"
who
echo "[df]"
if [ $vmnix ]; then
    # Use "vdf" to report about vmfs file systems
    sudo /usr/sbin/vdf -P | egrep -v "\/vmfs\/devices|none|tmpfs|shmfs|unknown|iso9660"
else
    df -Pl -x none -x tmpfs -x shmfs -x unknown -x iso9660 | sed -e '/^[^ ][^ 	]*$/{
N
s/[ 	]*\n[ 	]*/ /
}'
fi
quoted from Jason Altrincham Jones
...
...
# $TOP must be set, the install utility should do that for us if it exists.

if test "$TOP" != ""
then
     if test -x "$TOP"
     then
         echo "[top]"
         if [ ! $vmnix ]; then
            # Do not use top on ESX3 (only reports about the console)
	   $TOP -b -n 1
         fi
     fi
fi


Dominique
UNIL - University of Lausanne
list Chris Brown · Wed, 4 Jul 2007 10:30:40 +0100 ·
I have written some checks for both esx 25x and esx3.

These should probably be re-written at some stage, just haven't taken the
time to yet, but I hope you get some ideas.

For ESX 3.0.1 and up you can take the OO approach with VMPerl  (See example
one) [it's very slow]. I say use 3.0.1 because although the sdk manual says
these methods are supported in esx 3.0.0 there seem to be some problems with
VmPerl that are fixed in 3.0.1.

Or you can do most of this stuff by parsing the /proc nodes (see example 2
and 3 below)

EX 1.
use VMware::VmPerl;
use VMware::VmPerl::VM;
use VMware::VmPerl::ConnectParams;
use strict;

my @list_of_cfg = </proc/vmware/vm/*/names>; foreach (@list_of_cfg) {
        my $file_info = `cat $_`;
        my @get_vmx_info = split(/\s+/,$file_info);
        my $cfg_path = $get_vmx_info[2];
        $cfg_path =~ s/cfgFile.//g;
        $cfg_path =~ s/\"//g;
        #print "$cfg_path\n"; }

        my $connect_params = VMware::VmPerl::ConnectParams::new;
        my $vm = VMware::VmPerl::VM::new();
        my $i;
        if (!$vm->connect($connect_params, $cfg_path)) {
        my ($error_number, $error_string) = $vm->get_last_error();
        undef $vm;
        die "Could not connect to vm: Error $error_number: $error_string\n";
        }

        my $name1 = $vm->get_config('displayName');
        my $mem = $vm->get_config('memsize');
        my $OS = $vm->get_config('guestOS');
        my $mem_active = $vm->get_resource('mem.active');
        my $mem_ovhd = $vm->get_resource('mem.overhd');
        my $cpu = $vm->get_resource('cpu.number');
        my $mem_swap_in = $vm->get_resource('mem.swapin');
        my $mem_shared = $vm->get_resource('mem.shared');


        print
"\n---------------------------------------------------------------
------------\n";
        print "\tMachine Name is: $name1\n";
        print "\tMachine has: $mem MB RAM\n";
        print "\tOS: $OS\n";
        print "\tNum cpu's: $cpu CPU\n";
        print "\t--------------------stats--------------------\n";
        for($i=0; $i<$cpu; $i++) {

        my $usedsec = $vm->get_resource("cpu.${i}.usedsec");

        print "\tUsed vmkernel cpu time for cpu${i}: $usedsec (sec)\n";

}
        print "\tMem swapped in: $mem_swap_in\n";
        print "\tMem active: $mem_active\n";
        print "\tMem overhead: $mem_ovhd\n";
        print "\tMem shared: $mem_shared\n"; }

EX2 This gets the swapped/swptgt from /proc/vmware/sched/mem This should
work for esx 25x and 3x. (haven't really experimented much though)

open (INPUT, $proc_vmware_mem) || die "Could not open the file
$proc_vmware_mem. Exiting";

my @proc_mem_details=<INPUT>;

close INPUT;
my $lastline = $#proc_mem_details;
$lastline--;

#print "LAST_LINE=$lastline\n";
#       The data we're concerned with is located between line 16 and last
line -1 my @vm_details=@proc_mem_details[16..$lastline];

foreach my $vm_instance (@vm_details)
{
        #       We now need to break down the fields for each instance
        #       Replace the space with a definable symbol
        $vm_instance=~s/\ +/-/g;
        $vm_instance=~s/\/-/:/g;
        $vm_instance=~s/\//:/g;
        $vm_instance=~s/:/-/g;
        my @vm_instance_details=split(/-/,$vm_instance);

        my $vm_id=$vm_instance_details[1];
        my $size=$vm_instance_details[5];
        my $sizetgt=$vm_instance_details[6];
        $sizetgt=~ s/\///g;
        my $memctl=$vm_instance_details[7];
        my $mctltgt=$vm_instance_details[8];
        $mctltgt=~ s/\///g;
        #       We will get the actual name of the vmware instance
referenced by vmid from
        my $vm_name_detail=`cat /proc/vmware/vm/$vm_id/names`;
        my @vm_name_details=split(/\ /,$vm_name_detail);
        my $vm_name=$vm_name_details[$#vm_name_details];
        $vm_name=~ s/\"//g;
        $vm_name=~ s/displayName\=//g;
        chomp $vm_name;

        my $percentage=($sizetgt/$size);
        $percentage=sprintf "%2d", 100 *$percentage;

        #       Now check the stats
        if ($percentage > $paging_threshold){
                print "ERROR\t-\tThe VM $vm_name is exceeding the allocated
paging threshold ($percentage\%/$paging_threshold\%)\n";
                $num_in_error++;
        }else{
                print "The VM $vm_name is within the allocated paging
threshold ($percentage\%/$paging_threshold\%)\n";

        }
}

if ($num_in_error gt 0){
        exit(255);
}else{
        exit(0);
}

EX3
This takes a look at the disk q length to the luns(and some other info),
sleeps for a defined interval, runs the check again and compares the values

#!/usr/bin/perl -w
use strict;

my @vmhba_ar = < /proc/vmware/scsi/vmhba*/?:* >; my (@outer_vmfs_contents,
@outer_vmhba_ar, @r1, @r2, @vmfs_subdirs); my @bigger = (\@r1, \@r2); my
$counter=0; my $check_int=2; my $threshold=3; my $num_in_error;

my $lastline_global = $#bigger;

my $dir = "/vmfs/volumes";
opendir(VMFS, $dir) || die "cant open $dir $!\n"; my @vmfs_contents =
readdir VMFS; close VMFS; chdir $dir;


foreach (@vmfs_contents) {
        if (-l $_ && !  m/^\./ ) {
        chomp;
        push @vmfs_subdirs, $_;
        my @smaller = `sudo /usr/sbin/vmkfstools -Ph $_`;
        push @outer_vmfs_contents, \@smaller; } }

foreach (@bigger) {
        $counter++;
        foreach (@vmhba_ar) {
                my @get_name=split(/scsi/,$_);
                my $name=$get_name[1];
                $name =~ s/\//:/g;
                $name =~ s/^\://g;

                open(INPUT, $_) || die "cant open $_ $!\n";
                my @temp=<INPUT>;
                close INPUT;
                my $lastline = $#temp;
                my $line_of_interest = $temp[$lastline];
                chomp $line_of_interest;
                if ($counter le $lastline_global) {
                push @r1, $line_of_interest; }
                else {
                push @r2, $line_of_interest; }

} if ($counter le $lastline_global) {
        sleep $check_int; }
}

#              This wi
grep {
        my @get_qd_r1=split(/\s+/,$r1[$_]);
        my $qd_r1=$get_qd_r1[3];
        my @get_qd_r2=split(/\s+/,$r2[$_]);
        my $qd_r2=$get_qd_r2[3];
        my $press = ($qd_r2 - $qd_r1);
        if ($press <= $threshold) {
                push @outer_vmhba_ar, $r2[$_]; }
        else { my $string = "WARNING - Q'D IO -> \t\t $r2[$_] \n" ;
                push @outer_vmhba_ar, $string;
       $num_in_error++ ; }
} 0..$#r1;

grep {
        print "\n", @{$outer_vmfs_contents[$_]},  $outer_vmhba_ar[$_],
"\n\n"; } 0..$#outer_vmfs_contents;

if ($num_in_error gt 0){
        exit(255);
}else{
        exit(0);
}


I'll get round to cleaning these up and making them available at some stage.
I've been very lazy though and just left them as is.

Hope you get some ideas from these.

Chris
list Aaron Stranberg · Thu, 5 Jul 2007 11:54:37 -0400 ·
Thanks! That is very helpful information, would you be willing to share your
compiled rhel3 version of the hobbit client?

Thanks
-Aaron
quoted from Chris Brown

On 7/4/07, chris brown <user-dcbae56006b3@xymon.invalid> wrote:
I have written some checks for both esx 25x and esx3.

These should probably be re-written at some stage, just haven't taken the
time to yet, but I hope you get some ideas.

For ESX 3.0.1 and up you can take the OO approach with VMPerl  (See
example one) [it's very slow]. I say use 3.0.1 because although the sdk
manual says these methods are supported in esx 3.0.0 there seem to be some
problems with VmPerl that are fixed in 3.0.1.

Or you can do most of this stuff by parsing the /proc nodes (see example 2
and 3 below)

EX 1.
use VMware::VmPerl;
use VMware::VmPerl::VM;
use VMware::VmPerl::ConnectParams;
use strict;

my @list_of_cfg = </proc/vmware/vm/*/names>; foreach (@list_of_cfg) {
        my $file_info = `cat $_`;
        my @get_vmx_info = split(/\s+/,$file_info);
        my $cfg_path = $get_vmx_info[2];
        $cfg_path =~ s/cfgFile.//g;
        $cfg_path =~ s/\"//g;
        #print "$cfg_path\n"; }

        my $connect_params = VMware::VmPerl::ConnectParams::new;
        my $vm = VMware::VmPerl::VM::new();
        my $i;
        if (!$vm->connect($connect_params, $cfg_path)) {
        my ($error_number, $error_string) = $vm->get_last_error();
        undef $vm;
        die "Could not connect to vm: Error $error_number:
$error_string\n";
        }

        my $name1 = $vm->get_config('displayName');
        my $mem = $vm->get_config('memsize');
        my $OS = $vm->get_config('guestOS');
        my $mem_active = $vm->get_resource('mem.active');
        my $mem_ovhd = $vm->get_resource('mem.overhd');

        my $cpu = $vm->get_resource(' cpu.number');
quoted from Chris Brown
        my $mem_swap_in = $vm->get_resource('mem.swapin');
        my $mem_shared = $vm->get_resource('mem.shared');


        print
"\n---------------------------------------------------------------
------------\n";
        print "\tMachine Name is: $name1\n";
        print "\tMachine has: $mem MB RAM\n";
        print "\tOS: $OS\n";
        print "\tNum cpu's: $cpu CPU\n";
        print "\t--------------------stats--------------------\n";
        for($i=0; $i<$cpu; $i++) {

        my $usedsec = $vm->get_resource("cpu.${i}.usedsec");

        print "\tUsed vmkernel cpu time for cpu${i}: $usedsec (sec)\n";

}
        print "\tMem swapped in: $mem_swap_in\n";
        print "\tMem active: $mem_active\n";
        print "\tMem overhead: $mem_ovhd\n";
        print "\tMem shared: $mem_shared\n"; }

EX2 This gets the swapped/swptgt from /proc/vmware/sched/mem This should
work for esx 25x and 3x. (haven't really experimented much though)

open (INPUT, $proc_vmware_mem) || die "Could not open the file
$proc_vmware_mem. Exiting";

my @proc_mem_details=<INPUT>;

close INPUT;
my $lastline = $#proc_mem_details;
$lastline--;

#print "LAST_LINE=$lastline\n";
#       The data we're concerned with is located between line 16 and last
line -1 my @vm_details=@proc_mem_details[16..$lastline];

foreach my $vm_instance (@vm_details)
{
        #       We now need to break down the fields for each instance
        #       Replace the space with a definable symbol
        $vm_instance=~s/\ +/-/g;
        $vm_instance=~s/\/-/:/g;
        $vm_instance=~s/\//:/g;
        $vm_instance=~s/:/-/g;
        my @vm_instance_details=split(/-/,$vm_instance);

        my $vm_id=$vm_instance_details[1];
        my $size=$vm_instance_details[5];
        my $sizetgt=$vm_instance_details[6];
        $sizetgt=~ s/\///g;
        my $memctl=$vm_instance_details[7];
        my $mctltgt=$vm_instance_details[8];
        $mctltgt=~ s/\///g;
        #       We will get the actual name of the vmware instance
referenced by vmid from
        my $vm_name_detail=`cat /proc/vmware/vm/$vm_id/names`;
        my @vm_name_details=split(/\ /,$vm_name_detail);
        my $vm_name=$vm_name_details[$#vm_name_details];
        $vm_name=~ s/\"//g;
        $vm_name=~ s/displayName\=//g;
        chomp $vm_name;

        my $percentage=($sizetgt/$size);
        $percentage=sprintf "%2d", 100 *$percentage;

        #       Now check the stats
        if ($percentage > $paging_threshold){
                print "ERROR\t-\tThe VM $vm_name is exceeding the
allocated paging threshold ($percentage\%/$paging_threshold\%)\n";
                $num_in_error++;
        }else{
                print "The VM $vm_name is within the allocated paging
threshold ($percentage\%/$paging_threshold\%)\n";

        }
}

if ($num_in_error gt 0){
        exit(255);
}else{
        exit(0);
}

EX3
This takes a look at the disk q length to the luns(and some other info),
sleeps for a defined interval, runs the check again and compares the values

#!/usr/bin/perl -w
use strict;

my @vmhba_ar = < /proc/vmware/scsi/vmhba*/?:* >; my (@outer_vmfs_contents,
@outer_vmhba_ar, @r1, @r2, @vmfs_subdirs); my @bigger = (\@r1, \@r2); my
$counter=0; my $check_int=2; my $threshold=3; my $num_in_error;

my $lastline_global = $#bigger;

my $dir = "/vmfs/volumes";
opendir(VMFS, $dir) || die "cant open $dir $!\n"; my @vmfs_contents =
readdir VMFS; close VMFS; chdir $dir;


foreach (@vmfs_contents) {
        if (-l $_ && !  m/^\./ ) {
        chomp;
        push @vmfs_subdirs, $_;
        my @smaller = `sudo /usr/sbin/vmkfstools -Ph $_`;
        push @outer_vmfs_contents, \@smaller; } }

foreach (@bigger) {
        $counter++;
        foreach (@vmhba_ar) {
                my @get_name=split(/scsi/,$_);
                my $name=$get_name[1];
                $name =~ s/\//:/g;
                $name =~ s/^\://g;

                open(INPUT, $_) || die "cant open $_ $!\n";
                my @temp=<INPUT>;
                close INPUT;
                my $lastline = $#temp;
                my $line_of_interest = $temp[$lastline];
                chomp $line_of_interest;
                if ($counter le $lastline_global) {
                push @r1, $line_of_interest; }
                else {
                push @r2, $line_of_interest; }

} if ($counter le $lastline_global) {
        sleep $check_int; }
}

#              This wi
grep {
        my @get_qd_r1=split(/\s+/,$r1[$_]);
        my $qd_r1=$get_qd_r1[3];
        my @get_qd_r2=split(/\s+/,$r2[$_]);
        my $qd_r2=$get_qd_r2[3];
        my $press = ($qd_r2 - $qd_r1);
        if ($press <= $threshold) {
                push @outer_vmhba_ar, $r2[$_]; }
        else { my $string = "WARNING - Q'D IO -> \t\t $r2[$_] \n" ;
                push @outer_vmhba_ar, $string;
       $num_in_error++ ; }
} 0..$#r1;

grep {
        print "\n", @{$outer_vmfs_contents[$_]},  $outer_vmhba_ar[$_],
"\n\n"; } 0..$#outer_vmfs_contents;

if ($num_in_error gt 0){
        exit(255);
}else{
        exit(0);
}


I'll get round to cleaning these up and making them available at some
stage. I've been very lazy though and just left them as is.

Hope you get some ideas from these.

Chris

list Michael M Mirasol · Tue, 10 Jul 2007 16:07:07 +0800 ·
Hi guys,

 
I am not that good in Linux yet, and I will be setting up this Hobbit. I
have installed a Fedora Core 6.0  and don't know what to do next to
install hobbit. I will be using it to monitor Window based PCs. Can you
please help me out, give me some tips and some reference materials to do
this?

 
Regards,

3M
list Sello Tlabela SD · Tue, 10 Jul 2007 10:59:32 +0200 ·
Hi

http://hobbitmon.sourceforge.net/docs/hobbit-tips.html
http://hobbitmon.sourceforge.net/
http://hobbitmon.sourceforge.net/docs/man-index.html
quoted from Michael M Mirasol


On Tue, 2007-07-10 at 16:07 +0800, Mirasol, Michael M wrote:
Hi guys,

 
I am not that good in Linux yet, and I will be setting up this Hobbit.
I have installed a Fedora Core 6.0  and don’t know what to do next to
install hobbit. I will be using it to monitor Window based PCs. Can
you please help me out, give me some tips and some reference materials
to do this?

 
Regards,

3M

Regards,
Sello Tlabela | Ops Specialist | ISS Infrastructure | Telkom E-Mail:  user-68d80b7df288@xymon.invalid | Office: +XX XX XXX XXXX | Fax: +XX XX
680 3299 | Cell:+XXXXXXXXXXX


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
list Rodolfo Pilas · Tue, 10 Jul 2007 12:52:30 -0300 ·
quoted from Sello Tlabela SD
Mirasol, Michael M escribió:
I am not that good in Linux yet, and I will be setting up this Hobbit. I
have installed a Fedora Core 6.0  and don’t know what to do next to
install hobbit. I will be using it to monitor Window based PCs. Can you
please help me out, give me some tips and some reference materials to do
this?
Take a look on wikibook documentation:
http://en.wikibooks.org/wiki/System_Monitoring_with_Hobbit

Install windows client (bbmon)
http://sourceforge.net/projects/bbwin

Simple steps:
a) Record windows pc into bb-hosts file.
b) Install windows client (read bbmon documentation)
c) Improve your installation

Regards
Rodolfo Pilas