# How to get the available and used value of memory and cpu of every Virtual machine in Opennebula 5.0.2 using XML-RPC?

**URL:** <https://forum.opennebula.io/t/how-to-get-the-available-and-used-value-of-memory-and-cpu-of-every-virtual-machine-in-opennebula-5-0-2-using-xml-rpc/3172>\
**Category:** Integration Support\
**Created:** [October 25, 2016, 4:08am UTC](https://forum.opennebula.io/t/how-to-get-the-available-and-used-value-of-memory-and-cpu-of-every-virtual-machine-in-opennebula-5-0-2-using-xml-rpc/3172 "2016-10-25T04:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![surya](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/surya/32/5097_2.png) [@surya](https://forum.opennebula.io/u/surya)\
**Post date:** [October 25, 2016, 4:08am UTC](https://forum.opennebula.io/t/how-to-get-the-available-and-used-value-of-memory-and-cpu-of-every-virtual-machine-in-opennebula-5-0-2-using-xml-rpc/3172/1 "2016-10-25T04:08:41Z")

</div>

I want to get the values of cpu and memory usage. How to get those data?

---

<div class="post-metadata">

**Author:** ![panterrap](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/panterrap/32/6409_2.png) [@panterrap](https://forum.opennebula.io/u/panterrap)\
**Post date:** [October 27, 2016, 4:33pm UTC](https://forum.opennebula.io/t/how-to-get-the-available-and-used-value-of-memory-and-cpu-of-every-virtual-machine-in-opennebula-5-0-2-using-xml-rpc/3172/2 "2016-10-27T16:33:11Z")

</div>

I do not know!  
I need values of custom vars and sugest my personal solution :

install onecontext from [https://github.com/OpenNebula/addon-context-linux](https://github.com/OpenNebula/addon-context-linux)

and put your interesting information:

#old style  
#echo “curl -k -X “PUT” $ONEGATE\_ENDPOINT/vm --header “X-ONEGATE-TOKEN: $TOKENTXT” --header “X-ONEGATE-VMID: $VMID” --data-binary @$TMP\_DIR/metrics”

#new style  
echo "onegate vm update $VMID --data `cat $TMP_DIR/metrics`"

Some explain information at  
[https://www.lrz.de/services/compute/cloud\_en/cloud-onegate\_en/](https://www.lrz.de/services/compute/cloud_en/cloud-onegate_en/)

---

<div class="post-metadata">

**Author:** ![jfontan](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jfontan/32/18_2.png) [@jfontan](https://forum.opennebula.io/u/jfontan)\
**Post date:** [October 28, 2016, 8:29am UTC](https://forum.opennebula.io/t/how-to-get-the-available-and-used-value-of-memory-and-cpu-of-every-virtual-machine-in-opennebula-5-0-2-using-xml-rpc/3172/3 "2016-10-28T08:29:09Z")

</div>

The XML-RPC call is [one.vm.info](http://docs.opennebula.org/5.2/integration/system_interfaces/api.html#one-vm-info). You’ll get an xml with all the VM information in XML form. To get a example of this XML data you can use the command:

```auto
$ onevm show -x <vmid>

```
