VMware's host data acquisition

Source: Internet
Author: User
Tags uuid

In front of the memory, the cluster data acquisition, and now the host and the specific VM data is not written. Now, write the host profile data first.

//I'm not going to write the previous code. Because roughly the same  for(managedentity Managedentity:esxs) {Hostsystem HS=(Hostsystem) managedentity;////////////Hosthardwareinfo hwi=Hs.gethardware (); Hostlistsummary HSR=hs.getsummary (); Hoststoragesystem HD=Hs.gethoststoragesystem (); Hostsnmpsystem HIF=Hs.gethostsnmpsystem (); Hosthealthstatussystem PF=Hs.gethealthstatussystem (); //                        /*The host information gets System.out.println ("CPU UUID:" +hsr.gethardware (). UUID);                                                SYSTEM.OUT.PRINTLN ("CPU:" +hsr.gethardware (). Cpumhz);                        System.out.println ("Overallmemoryusage: Memory Consumed" +hsr.getquickstats (). Overallmemoryusage);                        System.out.println ("Distributedmemoryfairness:" +hsr.getquickstats (). distributedmemoryfairness);                        System.out.println ("Overallcpuusage:" +hsr.getquickstats (). Overallcpuusage);                        System.out.println ("Distributedmemoryfairness:" +hsr.getquickstats (). distributedcpufairness);                        SYSTEM.OUT.PRINTLN ("Processor socket:" +hsr.gethardware (). numcpupkgs);                        SYSTEM.OUT.PRINTLN ("CPU Core:" +hsr.gethardware (). NUMCPUCORES/2);                        SYSTEM.OUT.PRINTLN ("Logical Processor:" +hsr.gethardware (). numcputhreads); System.out.println ("Memorysize:" +hsr.gethardware (). memorysize);                        System.out.println ("Vendor:" +hsr.gethardware (). Vendor);                        System.out.println ("Cpumodel:" +hsr.gethardware (). Cpumodel);                        System.out.println ("Identifiervalue:" +hsr.gethardware (). Otheridentifyinginfo[0].identifiertype);                        System.out.println ("Hsr.gethost (). Type:" +hsr.gethost (). type); System.out.println ("Hsr.gethost (). Val:" +hsr.gethost (). val);*/                                                Longhz=hwi.cpuInfo.hz; LongE9 = 1000000000;
The value that the CPU obtains needs to be convertedDoubleHzd =NewJava.math.BigDecimal ((Double) (Hz)/E9). Setscale (2, Java.math.BigDecimal.ROUND_HALF_UP). Doublevalue ();//Host InformationSYSTEM.OUT.PRINTLN ("----"); System.out.println ("1 Host information:" +hs.getname ()); System.out.println ("2:" +string.valueof (HZD) + "GHZ"); System.out.println ("3: Connection person Information:" +hs.getserverconnection (). GetUserName ()); System.out.println ("4:" +hs.getserverconnection (). GETSESSIONSTR ()); System.out.println ("5:" +hs.getserverconnection (). Getserviceinstance (). Getaboutinfo (). name); System.out.println ("6:" +hs.getserverconnection (). Getserviceinstance (). Getalarmmanager ()); System.out.println ("7:" +hs.getserverconnection (). Getserviceinstance (). Getaboutinfo ()); System.out.println ("8: The current World" +hs.getserverconnection (). Getserviceinstance (). CurrentTime (). GetTime ()); System.out.println ("9:" +hs.getserverconnection (). Getserviceinstance (). Getcustomfieldsmanager (). GetField ()); System.out.println ("Capacity:" +hsr.gethardware (). memorysize/1024/1024); System.out.println ("11:" +Hs.getcustomvalue ()); System.out.println ("12:" +hs.getcapability (). Maxhostrunningvms); System.out.println ("==========="); System.out.println ("+hs.getavailablefield" () [0].name); System.out.println ("+hs.getavailablefield" () [0].managedobjecttype); System.out.println ("+hs.getavailablefield" () [0].type); System.out.println ("==========="); System.out.println ("+:" +hs.getavailablefield () [1].name); System.out.println (":" +hs.getavailablefield () [1].managedobjecttype); System.out.println ("+:" +hs.getavailablefield () [1].type); System.out.println ("15:" +hs.getcapability ());}

VMware's host data acquisition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.