# Monitor "capacity" tab using CLI (Command Line Interface)

**URL:** <https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712>\
**Category:** Product Support\
**Created:** [November 28, 2023, 12:01pm UTC](https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712 "2023-11-28T12:01:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Ruiz\_Molina](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@Daniel\_Ruiz\_Molina](https://forum.opennebula.io/u/Daniel_Ruiz_Molina)\
**Post date:** [November 28, 2023, 12:01pm UTC](https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712/1 "2023-11-28T12:01:38Z")

</div>

Hello,

I would like to get some way to monitor real CPU usage of each “running” VM, because some users leave their VMs doing “nothing” and resources are consumed.

I have seen in Sunstone that inside VM option, there are a “Capacity” tab that shows the real CPU usage.

 ![Screenshot 2023-11-28 at 12-57-30 OpenNebula Sunstone Cloud Operations Center](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/b/b686eeeead2747312c5721c265b68f24f51587d0.png)

Is there any way to get that information using CLI for, then, use that inside a bash script?

Thanks.

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [November 28, 2023, 1:17pm UTC](https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712/2 "2023-11-28T13:17:18Z")

</div>

That information can be seen on the VM instance template, which you can see with `onevm show <vm_id>`.

For example

```auto
root@provisionengine-test-env:~# onevm show 1034 | grep 'VIRTUAL MACHINE MONITORING' -A 11
VIRTUAL MACHINE MONITORING
CPU : 1.01
MEMORY : 124.5M
NETTX : 0K
NETRX : 0K
DISKRDBYTES : 13854296
DISKRDIOPS : 972
DISKWRBYTES : 385024
DISKWRIOPS : 151
ID : 1034
TIMESTAMP : 1701176925

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Ruiz\_Molina](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@Daniel\_Ruiz\_Molina](https://forum.opennebula.io/u/Daniel_Ruiz_Molina)\
**Post date:** [November 28, 2023, 1:24pm UTC](https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712/3 "2023-11-28T13:24:55Z")

</div>

Hi,

Yes, I knew that, and that value is updated “MONITOR\_VM” seconds inside "PROBES\_PERIOD (if I am not wrong…), but my question was if there was any way (not only run onevm show $vm\_id | grep “CPU” to get real CPU usage.

Also, thanks for your response 😉

---

<div class="post-metadata">

**Author:** ![dclavijo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dclavijo/32/5265_2.png) [@dclavijo](https://forum.opennebula.io/u/dclavijo)\
**Post date:** [December 4, 2023, 2:57pm UTC](https://forum.opennebula.io/t/monitor-capacity-tab-using-cli-command-line-interface/11712/4 "2023-12-04T14:57:11Z")

</div>

In this case everything is gathered from the VM entry in the database and is presented as a graph on the Web GUI view and as a value in the CLI.

What other way would be useful/expected ?
