Ad Widget

Collapse

Vmbix 1.1.0 released

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tatapoum
    Senior Member
    • Jan 2014
    • 185

    #1

    Vmbix 1.1.0 released

    Hi,

    I updated Vmbix to v1.1.0.
    You will find the jar and zip archive here : https://drive.google.com/folderview?...p=sharing#list. Or you can clone the SVN repo and compile it yourself.

    The website is still https://code.google.com/p/vmbix/.

    Here is the changelog :
    1.1.0
    - Fixed the unnecessary carriage return in the output
    - Added Zabbix Low-Level Discovery methods to automatically create datastores, hosts, virtual machines, and VM disks. A JSON-formatted output is displayed (using Google GSON), ex:
    Code:
     # zabbix_get -s localhost -p 12050 -k esx.discovery[*]
     {"data":[{"{#ESXHOST}":"esx0.domain.local"},{"{#ESXHOST}":"esx1.domain.local"}]}
    - Added several items
    * VMWare Performance Manager counters:
    Code:
      counters[name]: list the available counters for an entity (VM, host, datastore)
    Code:
      vm.counter[name,counter,[instance,interval]]: displays the value of the counter with optional interval/instance
    The method outputs an aggregated sum or average of real-time values, ex:
    Code:
      # zabbix_get -s localhost -p 12050 -k vm.counter[VMNAME,cpu.ready,,200] 
    491
    An additional interval parameter was added to the configuration file to specify the default interval for the performance counter queries.
    * VM Tools status methods
    * ping : always returns 1, to check vmbix availability
    * about : display vCenter SDK version
    * guest IP/hostname methods
    * etc
    - The status/powerstate methods now return an integer value instead of a string (ex: "poweredOff"). This is better to store integers than strings in Zabbix and allows for graphing. Typically :
    Code:
     Running State:
     0 -> poweredOff
     1 -> poweredOn
     2 -> suspended
     3 -> unknown 
    
     Status:
     0 -> grey
     1 -> green
     2 -> yellow
     3 -> red
     4 -> unknown
    - The Zabbix templates haven't been updated yet.

    Here is the full list of supported items :
    Code:
    about
    datastore.discovery
    datastore.size[name,free]
    datastore.size[name,total]
    esx.connection[name]
    esx.cpu.load[name,cores]
    esx.cpu.load[name,total]
    esx.cpu.load[name,used]
    esx.discovery
    esx.maintenance[name]
    esx.memory[name,total]
    esx.memory[name,used]
    esx.path[name,active]
    esx.path[name,dead]
    esx.path[name,disabled]
    esx.path[name,standby]
    esx.status[name]
    esx.vms.memory[name,active]
    esx.vms.memory[name,ballooned]
    esx.vms.memory[name,compressed]
    esx.vms.memory[name,consumed]
    esx.vms.memory[name,overheadConsumed]
    esx.vms.memory[name,private]
    esx.vms.memory[name,shared]
    esx.vms.memory[name,swapped]
    event.latest[*]
    counters[name]
    ping
    vm.consolidation[name,needed]
    vm.cpu.load[name,cores]
    vm.cpu.load[name,total]
    vm.cpu.load[name,used]
    vm.discovery[*]
    vm.folder[name]
    vm.guest.disk.all[name]
    vm.guest.disk.capacity[name,disk]
    vm.guest.disk.free[name,disk]
    vm.guest.ip[name]
    vm.guest.name[name]
    vm.guest.os[name]
    vm.guest.tools.mounted[name]
    vm.guest.tools.running[name]
    vm.guest.tools.version[name]
    vm.host[name]
    vm.memory[name,active]
    vm.memory[name,ballooned]
    vm.memory[name,compressed]
    vm.memory[name,consumed]
    vm.memory[name,overheadConsumed]
    vm.memory[name,private]
    vm.memory[name,shared]
    vm.memory[name,swapped]
    vm.memory[name,total]
    vm.counter[name,counter,[instance,interval]]
    vm.powerstate[name]
    vm.status[name]
    vm.storage.committed[name]
    vm.storage.uncommitted[name]
    vm.storage.unshared[name]
    Let me know what you think of it.
    Last edited by tatapoum; 05-05-2014, 23:04.
  • danrog
    Senior Member
    • Sep 2009
    • 164

    #2
    Hi tatapoum,

    I've added two additional checks to the original version that we need for some of our Lab VM servers. Is this something you can add (I'm not very familiar with svn or even Java really). I haven't looked at the current versions source code to see if it follows the same format as the original version:

    PHP Code:
    Pattern pDatastoreProvisioned   Pattern.compile("^(?:\\s*ZBXD.)?.*datastore\\.size\\[(.+),provisioned\\]"         );        //
    Pattern pDatastoreUncommitted   Pattern.compile("^(?:\\s*ZBXD.)?.*datastore\\.size\\[(.+),uncommitted\\]"       );        //
    ....

    found checkPattern(pDatastoreProvisioned  ,string); if (found != null) { getDatastoreSizeProvisioned (foundout); return; }
    found checkPattern(pDatastoreUncommitted   ,string); if (found != null) { getDatastoreSizeUncommitted(foundout); return; }

    ....

            private 
    void getDatastoreSizeProvisioned            (String dsName,   PrintWriter outthrows IOException {
                
    long start System.currentTimeMillis();
                
    Datastore ds = (Datastore)getManagedEntityByName(dsName,"Datastore");
                
    Long provSpace;
                if (
    ds == null) {
                    
    long end System.currentTimeMillis();
                    
    System.out.print("No datastore named '" dsName "' found\n");
                    
    // request took:" + (end-start) + "\n");
                    
    provSpace = new Long(0);
                } else {
                    
    long total  returnDatastoreSizeTotal(dsName);
                    
    long free   returnDatastoreSizeFree(dsName);
                    
    long uncom  returnDatastoreSizeUncommitted(dsName);
                    
    long temp   total free uncom;
                    
    provSpace   temp;
                    if (
    provSpace == null) {
                        
    provSpace = new Long(0);
                    }
                    
    // System.out.println("store " + dsName +" free: " + freeSpace
                    // + "\n it took " + (System.currentTimeMillis() - start) );
                
    }
                
    out.print(provSpace "\n");
                
    out.flush();
            }

            private 
    void getDatastoreSizeUncommitted            (String dsName,   PrintWriter outthrows IOException {
                
    long start System.currentTimeMillis();
                
    Datastore ds = (Datastore)getManagedEntityByName(dsName,"Datastore");
                
    Long freeSpace;
                if (
    ds == null) {
                    
    long end System.currentTimeMillis();
                    
    System.out.print("No datastore named '" dsName "' found\n");
                    
    // request took:" + (end-start) + "\n");
                    
    freeSpace = new Long(0);
                } else {
                    
    DatastoreSummary dsSum ds.getSummary();
                    
    freeSpace dsSum.getUncommitted();
                    if (
    freeSpace == null) {
                        
    freeSpace = new Long(0);
                    }
                    
    // System.out.println("store " + dsName +" free: " + freeSpace
                    // + "\n it took " + (System.currentTimeMillis() - start) );
                
    }
                
    out.print(freeSpace "\n");
                
    out.flush();
            } 

    Comment

    • tatapoum
      Senior Member
      • Jan 2014
      • 185

      #3
      It seems ok. I'll try to add this ASAP and release a 1.1.1 version.

      Comment

      • tatapoum
        Senior Member
        • Jan 2014
        • 185

        #4
        I've added your items to a 1.1.1 version :


        Originally posted by tatapoum
        It seems ok. I'll try to add this ASAP and release a 1.1.1 version.

        Comment

        Working...