Jump to content
Welcome to our new Citrix community!
  • 0

Some XenServer attributes such as "CPU utilisation" could not be retrieved by Citrix XenServer Management API


wei qin

Question

I used the com.xensource.xenapi.HostCpu  which is from Citrix XenServer Management API (xenserver-6.0.0.jar) to get XenServer 7.1Cu2 env's  CPU related information such as the vendor of the physical CPU(HostCPU.vendor), the speed of the physical CPU(HostCPU.speed) , the model name of the physical CPU(HostCPU.modelname) and also including the current CPU utilisation(HostCPU.utilisation). Most attributes can get the correct values, but for CPU utilisation, it's always empty.

And I also find many attributes related to memory used/total size , net work in/out throughput etc. could not get the correct values.

Any idea about that?

Thanks in advance.

 

Link to comment

1 answer to this question

Recommended Posts

  • 0

 

I updated some detail information, hope can inspire someone, anyway thanks in advance. 

 

XenServer version : 7.1 Cu2

XenServer JAVA SDK : xenserver-6.0.0-1.jar along with xmlrpc-client-3.1.3.jar and xmlrpc-common-3.1.3.jar

A piece of my JAVA code:

-----------------------------------------------------

……

import com.xensource.xenapi.HostCpu;

……

public IAttributeGroupRecord mapRecord(HostCpu.Record record, Connection connection) throws Types.XenAPIException, XmlRpcException {

  ……

   attributeGroupRecord.add(str(record.model));

   attributeGroupRecord.add(str(record.modelname));

   attributeGroupRecord.add(str(record.speed));

   attributeGroupRecord.add(str(record.stepping));

   attributeGroupRecord.add(str(MessageFormat.format("{0,number,###.##}", record.utilisation), (record.utilisation != null) ));

   attributeGroupRecord.add(str(record.vendor));

   ……

   return attributeGroupRecord;

 }

---------------------------------------------------

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...