Ad Widget

Collapse

VmBix: vsphere monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hryamzik
    Junior Member
    • Dec 2011
    • 16

    #1

    VmBix: vsphere monitoring

    Let me share my experience in vsphere monitoring. We have a pretty large environment and have to monitor some VMs and ESX hosts. Installing zabbix agents is not acceptable: we are not permitted to install anything on ESXs and VMs we have to monitor run some specific OS.

    So the first thing I've done was a number of external checks involving VMWare perl SDK. Every check took forever to complete so the next step was to write a TCP server, connect it to vCenter on startup and save some time. This did speedup checks but resulted in some CPU load and huge data gaps. At that time we had about 500 checks per minute. I guess this way could work for about 20 check per minute, depending on vsphere response time, of course. "No problem, let's use threads!" – was my next idea. And it didn't work, I got my scripts crashing on thread.join() call. What next? Replace threads with processes?

    At this point I've had a look on java SDK. The one provided by VMWare seems to be awful, but there's a vijava sdk written by Steve Jin. I believe he works at VMWare. =)

    So this resulted in a small java project that does all the checks I needed. Here's the list of currently supported ones:
    status[hostname]
    esx.cpu.load[hostname,used]
    esx.cpu.load[hostname,total]
    esx.cpu.load[hostname,cores]
    esx.memory[hostname,used]
    esx.memory[hostname,total]
    vm.cpu.load[vmname,used]
    vm.cpu.load[vmname,total]
    datastore.size[datastorename,free]
    datastore.size[datastorename,total]

    I've also create zabbix templates, they include calculated items to find out CPU, memory and datastore usage in %.

    Init scripts to run this tool as daemon are also provided. All the stuff is tested on rhel 6 only. Feel free to ask for new checks, other feature requests and to report bugs at the VmBix google code page.
  • eskytthe
    Senior Member
    Zabbix Certified Specialist
    • May 2011
    • 363

    #2
    Thanks hryamzik!
    This look cool - will test it soon.
    Maybe you can put it on the zabbix wiki also ...
    BR
    Erik

    Comment

    • hryamzik
      Junior Member
      • Dec 2011
      • 16

      #3
      Wow, I didn't know zabbix wiki pages can be modified. I got used to product read-only wikies (and do hate them, especially outdated ones =) ).

      I'm not sure about a right place for this article though.

      Comment

      • eskytthe
        Senior Member
        Zabbix Certified Specialist
        • May 2011
        • 363

        #4
        Well I actually see two kind of zabbix wikis

        At the old wiki it could be here:
        http://www.zabbix.com/wiki/howto/monitor

        At the new "wiki" http://zabbix.org/wiki/Main_Page I am not sure ...
        BR
        Erik

        Comment

        • eskytthe
          Senior Member
          Zabbix Certified Specialist
          • May 2011
          • 363

          #5
          Ok just spotted this on the IRC today from the Zabbix master

          "<Richlv> although new stuff might be better to add to zabbix.org"

          So zabbix.org most be the best place.
          /Erik

          Comment

          • clahti
            Senior Member
            • Jan 2007
            • 126

            #6
            Multiple Datastore?

            I just downloaded and compiled this java application on CentOS 6, things seem to work ok. I am now looking at the templates provided, using datastores as a test. It looks like it uses the value in HOST.DNS as the string to pass to vCenter for the datastore to monitor, but what if I have multiple datastores being served? Do I need to have one host per datastore defined? Alternatively I have pretty strict naming, I suppose I could clone the template to be:

            DNS.HOSTNAME-lun0
            DNS.HOSTNAME-lun1

            etc.

            I am using Zabbix 2.0.3, and wondering if there is a better way. Lastly if I use zabbix_get on the command line to get [DNS.HOSTNAME,total] I do get a value but the template inserts a ZERO value for this particular item. Any ideas here as well?

            Comment

            • neoyagami
              Junior Member
              • Jan 2009
              • 13

              #7
              it works nice
              just a few things.

              how to monitor lone esx server (non venter)
              if i try to read esx.cpu.load[local,used]
              i dont know hoy to pass the name for the esx server if there are no a vcenter
              i try with the ip of the server but it says
              No host named 'ipaddr' found
              also lld support would be great

              cherrs.

              Comment

              • mfric
                Junior Member
                • Nov 2012
                • 7

                #8
                same issue here. Can u help me please?

                Comment

                • r0k5t4r
                  Member
                  • Jun 2009
                  • 91

                  #9
                  Hi,

                  is anyone successfully using the script? I have implemented it but I can't import the VM template. I get an error during import:

                  Incorrect item key "Template VM:check_VM_rules.sh[{HOST.DNS}]" provided for trigger expression.
                  Trigger [VM server {HOSTNAME} contains stale VM rules ]: cannot create

                  Regards,

                  Comment

                  • extress
                    Member
                    • Jul 2012
                    • 32

                    #10
                    Originally posted by r0k5t4r
                    Hi,

                    is anyone successfully using the script? I have implemented it but I can't import the VM template. I get an error during import:

                    Incorrect item key "Template VM:check_VM_rules.sh[{HOST.DNS}]" provided for trigger expression.
                    Trigger [VM server {HOSTNAME} contains stale VM rules ]: cannot create

                    Regards,

                    Comment

                    • r0k5t4r
                      Member
                      • Jun 2009
                      • 91

                      #11
                      Hi,

                      thanks for pointing me in the right direction.

                      Regards,
                      Oliver

                      Comment

                      • r0k5t4r
                        Member
                        • Jun 2009
                        • 91

                        #12
                        Has anyone ever tried to change the java script so it monitors more metrics like CPU READY?

                        Comment

                        • heaje
                          Senior Member
                          Zabbix Certified Specialist
                          • Sep 2009
                          • 325

                          #13
                          @hryamzik - I just wanted to say thanks for creating such a useful tool like this. I'm not using it at the moment, but I can almost guarantee that I will be within the next year.

                          Comment

                          • r0k5t4r
                            Member
                            • Jun 2009
                            • 91

                            #14
                            It is indeed a really cool tool.

                            Comment

                            • onesickadmin
                              Junior Member
                              • Jan 2013
                              • 1

                              #15
                              Hi!
                              Which versions of ESXi are supported?

                              Comment

                              Working...