Ad Widget

Collapse

ESXi 4.0 Hardware and Software Monitoring VMWare

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dima_dm
    Senior Member
    • Dec 2009
    • 2697

    #31
    Originally posted by Toepfer
    OK, it works perfectly, Thx

    Can I remove the IP, username and password in the .pl files as it seems to that they are not used and taken from the template?
    Yes. It is add for test purpose only (from command line).

    Comment

    • acalvo
      Member
      • Oct 2010
      • 30

      #32
      Very nice, thanks!

      Is this suitable for ESX 4.1 (on HP DL360 G6)?
      And, is there any way to monitor the status of the virtual machines of an ESX/i server?

      I've been looking thru SNMP MIBs, but it does only shows details of the ESX server.

      Thanks
      Last edited by acalvo; 30-12-2010, 12:47.

      Comment

      • dima_dm
        Senior Member
        • Dec 2009
        • 2697

        #33
        Originally posted by acalvo
        Very nice, thanks!

        Is this suitable for ESX 4.1 (on HP DL360 G6)?
        Yes. For all ESX/ESXi 4.0 and 4.1 release
        Originally posted by acalvo
        And, is there any way to monitor the status of the virtual machines of an ESX/i server?
        Use
        VMware Infrastructure (VI) Perl Toolkit Programming Guide

        But I use Linux and Windows template and zabbix_agent for monitoring guest OS.
        Last edited by dima_dm; 30-12-2010, 14:19.

        Comment

        • scanch
          Junior Member
          • Oct 2010
          • 8

          #34
          Good Job dima_dm, Thanks !
          Got the script working with Proliant DL380 G5 and G6 too (ESXi 4.1 with HP tools).

          Some problems on DL360 G5 under ESXi 3.5 (with HP tools) with WBEM: some classes are missing (Array classes like SMX_SAArraySystem). Perl-CLI script is working well. So I think I will cut the template into two parts: WBEM and Perl-CLI.

          A tip, if you don't want to use root user (and the root password):
          - Create a Role with right only on Host/CIM/CIM Interaction
          - Create a user for zabbix and put it on the "root" group (user must be in the group in order to use WBEM and be in the group don't seems that you can make more thing that the role where you are).
          - Give a permission with the role and the user
          And now you can use this user to have monitoring informations. The user can long on the ESXi with VSphere Client but just have ReadOnly rights (better than root).

          Comment

          • 7zxzasa7
            Junior Member
            • Feb 2011
            • 1

            #35
            as a mac monitoring soft try http://www.protemac.com/keybag/

            Comment

            • Gav
              Junior Member
              • Jun 2010
              • 12

              #36
              I have started with playing with CIM access to ESXi (HW independed)

              First start here http://www.vmware.com/support/develo...ash/index.html

              There is API and Profile Ref (all supported objects and items you can pull)

              Then you need pywebm http://blogs.vmware.com/esxi/2010/04...g-via-cim.html (link to pywebm and some sample)

              My part of cim.py for monitoring vDs and pDs

              client = pywbem.WBEMConnection('https://'+options.server,
              (options.username, options.password),
              'root/cimv2')

              list = client.EnumerateInstances('VMware_DiskDrive')
              if list is None:
              print 'Error: Unable to locate any instances of VMware_HypervisorSoftwareIdentity'
              else:
              for i in range (len(list)):
              print str(list[i]['HealthState']) + '---' + 'Disk' + str(i) + '---' + list[i]['Name']


              list = client.EnumerateInstances('VMware_StorageVolume')
              if list is None:
              print 'Error: Unable to locate any instances of VMware_HypervisorSoftwareIdentity'
              else:
              for i in range (len(list)):
              print str(list[i]['HealthState']) + '---' + list[i]['ElementName']


              The output is following

              5---Disk0---Drive 0 in enclosure 32 on controller 0 - ONLINE
              5---Disk1---Drive 1 in enclosure 32 on controller 0 - ONLINE
              5---Disk2---Drive 2 in enclosure 32 on controller 0 - ONLINE
              5---Disk3---Drive 3 in enclosure 32 on controller 0 - ONLINE
              5---Disk4---Drive 4 in enclosure 32 on controller 0 - ONLINE
              5---Disk5---Drive 5 in enclosure 32 on controller 0 - ONLINE
              5---Disk6---Drive 6 in enclosure 32 on controller 0 - ONLINE
              5---Disk7---Drive 7 in enclosure 32 on controller 0 - ONLINE
              5---RAID 1 boot Logical Volume 0 on controller 0, Drives(0e32,1e32) - OPTIMAL
              5---RAID 5 data Logical Volume 1 on controller 0, Drives(2e32,3e32,4e32,5e32,6e32,7e32) - OPTIMAL

              Then you need just to extract desired values and port it to Zabbix

              Comment

              • Giors
                Junior Member
                • Aug 2010
                • 5

                #37
                Multiple VMwares

                Originally posted by dima_dm
                In Zabbix HOST IP Address = 127.0.0.1 for ALL ESXi hypervisor
                I just dont understand, how do you add multiple vmware hosts? I can import another template, but I cant add same items to the same host.

                Comment

                • dima_dm
                  Senior Member
                  • Dec 2009
                  • 2697

                  #38
                  Originally posted by Giors
                  I just dont understand, how do you add multiple vmware hosts? I can import another template, but I cant add same items to the same host.
                  You can create multiple hosts with same IP address [127.0.0.1].
                  Example:
                  Host_Name IP
                  VM1 127.0.0.1
                  VM2 127.0.0.1
                  VM3 127.0.0.1
                  etc.

                  Comment

                  • 753713
                    Senior Member
                    • Apr 2006
                    • 137

                    #39
                    another way to monitor vmware esx:

                    Browse with Yawn:

                    YAWN download: http://pywbem.svn.sourceforge.net/vi.../trunk/yawn.py

                    and configure the script:

                    script:

                    #!/usr/bin/python

                    import sys
                    import pywbem

                    wbemclient = pywbem.WBEMConnection("https://"+sys.argv[1], (sys.argv[2], sys.argv[3]), 'vmware/esxv2')
                    for instance in wbemclient.EnumerateInstances('CIM_ManagedElement' ) :
                    #if instance['ElementName'] == 'Proc 1' :
                    print "%s" % (instance['ElementName'])

                    use:
                    script ip user password
                    ______________________________
                    Version : 2.0.x
                    Server OS: Ubuntu 12.04
                    Zabbix Servers: 12
                    Monitored Windows Server: ~ 1000
                    ______________________________

                    Comment

                    • chewie71
                      Junior Member
                      • Feb 2011
                      • 12

                      #40
                      Hi dima_dm,

                      I'm using your scripts with success, mostly. But I do regularly see this error in my zabbix_agentd.log file.

                      Code:
                      Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                      Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                      Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                      Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                      Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                      Line 205 is the print statement in this block...
                      Code:
                      foreach  $i (keys(%hash))
                       {
                       print FILE "$i:\t$hash{$i}\n";
                       }
                      close(FILE);
                      return $error;
                      }
                      Any thoughts on why I get this error?

                      Thanks,
                      Matt

                      Comment

                      • dima_dm
                        Senior Member
                        • Dec 2009
                        • 2697

                        #41
                        Originally posted by chewie71
                        Hi dima_dm,

                        I'm using your scripts with success, mostly. But I do regularly see this error in my zabbix_agentd.log file.

                        Code:
                        Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                        Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                        Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                        Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                        Use of uninitialized value in concatenation (.) or string at /etc/zabbix/zabbix_perl_api_vmware.pl line 205.
                        Do you see line in your vmware_api_X.Y.Z.H.txt file without data?
                        Example
                        Key: Data
                        Key1:

                        Comment

                        • chewie71
                          Junior Member
                          • Feb 2011
                          • 12

                          #42
                          I looked through one of the files and I see a couple of oddities. The very first line has no key.

                          Code:
                          :       0
                          Then there are a couple keys with no vals...
                          Code:
                          Array_0.Read_latency.aver:
                          Array_3.Queue_write_laten:
                          Matt

                          Comment

                          • dima_dm
                            Senior Member
                            • Dec 2009
                            • 2697

                            #43
                            Originally posted by chewie71
                            Then there are a couple keys with no vals...
                            Code:
                            Array_0.Read_latency.aver:
                            Array_3.Queue_write_laten:
                            Problem may be in the code
                            Code:
                             if ($args{countertype} eq "disk" && $name ne "")
                                      {
                                      my $type=$counter->rollupType->val;
                                      my $desc=$counter->nameInfo->label;
                                      my $units=$counter->unitInfo->label;
                                      if (defined $ARRAY{$name})
                                         {
                                         $name=$ARRAY{$name};
                                         }else{
                                            my $i;
                                            my $max=-1;
                                            my $current=0;
                                            foreach $i (keys %ARRAY)
                                             {
                                             if ($ARRAY{$i}=~/Array_(\d+)/) {$current=$1; if ($current > $max) {$max=$current}}
                                             }
                                            $max++;
                                            $ARRAY{$name}="Array_".$max;
                                            $name=$ARRAY{$name};
                                            }
                                      $desc=~s/ /_/g;
                                      $desc=~s/"//g;
                                      $desc=~s/:/_/g;
                                      if ($name ne "" && $desc ne "" )
                                       {
                                       if ($units eq "KBps")
                                        {
                                        $API{$name.".".$desc.".".$type}=$Value[0] * 1024; # in Bps
                                        }else{
                                             $API{$name.".".$desc.".".$type}=$Value[0]; # Number or Millisecond
                                             }
                                       }
                                      }
                            You can add print operator. Why variable $Value[0] was not specified for this key? It’s may be bug in VMware Hypervisor or problem in VMware Disk Arrays configuration or bug in script zabbix_perl_api_vmware.pl.
                            Do you have 4 Disk Arrays in configuration VMware Hypervisor?
                            Last edited by dima_dm; 19-04-2011, 09:02.

                            Comment

                            • Colttt
                              Senior Member
                              Zabbix Certified Specialist
                              • Mar 2009
                              • 878

                              #44
                              how can i monitor esxi 4.1 via snmp?

                              can somebody give me a step-by-step-guide?

                              @dima_dm: where must i install the perl-api?!
                              Debian-User

                              Sorry for my bad english

                              Comment

                              • dougbee
                                Member
                                • Apr 2011
                                • 68

                                #45
                                I'm trying to run zabbix_perl_api_vmware.pl against vcenter, and am getting:

                                The --vihost option must be specified when connecting to vCenter.

                                I'm aware that this is generated by VIExt::get_host_view - any ideas? I thought I might be able to use Opts::set_option, but the syntax is evading me.

                                Comment

                                Working...